Skip to content

Commit 98ce18d

Browse files
arzoo14v0dro
authored andcommitted
Setup for Travis CI (#32)
* rubocopping * Update rubyplot.rb * setup_tavis_ci * Update rubyplot.rb * setup_travis_CI * color_related * Update color.rb * rubocop_offenses * fixed_rubocop_errors * travis_setup * changes * changes * changes * changes * changes * chnages * chnages * chnages * chnages * chnages * chnages * chnages * chnages * chnages * chnages * added * added * added * added * added * added * changes * changes * changes * changes * changes * changes * changes * changes * changess * final_changes * final changes * final changes * final changes * final changes * final changes * Update magick_wrapper.rb
1 parent 468f0b6 commit 98ce18d

File tree

10 files changed

+52
-3
lines changed

10 files changed

+52
-3
lines changed

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--format documentation
2+
--color
3+
--require spec_helper

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language:
2+
ruby
3+
4+
rvm:
5+
- '2.0'
6+
- '2.1'
7+
- '2.2'
8+
- '2.3.0'
9+
- '2.4.0'
10+
11+
script:
12+
- bundle exec rspec
13+
- bundle exec rubocop
14+
15+
install:
16+
- gem install bundler
17+
- gem install rainbow -v '2.2.1'
18+
- bundle install

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
source 'https://rubygems.org'
2+
23
gemspec
4+
5+
group :test do
6+
gem 'rake'
7+
gem 'rspec'
8+
end

Rakefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1+
require "bundler/gem_tasks"
2+
require "rake"
3+
4+
require 'bundler/setup'
5+
require 'rubygems/tasks'
6+
Gem::Tasks.new
7+
18
require 'rspec/core/rake_task'
2-
require 'rake/extensiontask'
9+
RSpec::Core::RakeTask.new
10+
11+
require 'rubocop/rake_task'
12+
RuboCop::RakeTask.new
13+
14+
desc 'Default: run unit specs.'
15+
task :default => %w[spec rubocop]
316

417
gemspec = eval(IO.read('rubyplot.gemspec'))
518

lib/rubyplot.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
require 'rubyplot/subplot'
1313
require 'rubyplot/spi'
1414

15-
require 'grruby.so'
1615
require 'rubyplot/gr_wrapper'
1716

1817
module Rubyplot
1918
def self.backend
2019
b = ENV['RUBYPLOT_BACKEND']
21-
return b.to_sym if %w[magick gr].include?(b)
20+
return b.to_sym if %w[magick ].include?(b)
2221

2322
:magick
2423
end

lib/rubyplot/artist/axes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,12 @@ def with_backend(plot_type, *args)
271271

272272
# Figure out the co-ordinates of the title text w.r.t Axes.
273273
def configure_title
274+
274275
@texts << Rubyplot::Artist::Text.new(
275276
@title, self, abs_x: abs_x + width / 2, abs_y: abs_y + @title_margin,
276277
font: @font, color: @font_color,
277278
pointsize: @title_font_size, internal_label: 'axes title.'
279+
278280
)
279281
end
280282

lib/rubyplot/artist/axis/base.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ def initialize axes
2323
@lines = []
2424
end
2525

26+
2627
def draw
2728
configure_title
2829
@lines.each(&:draw)
2930
@texts.each(&:draw)
3031
end
32+
3133
end
3234
# class Base
3335
end

lib/rubyplot/artist/text.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ class Text < Artist::Base
77

88
# rubocop:disable Metrics/ParameterLists
99
def initialize(text, owner, abs_x:, abs_y:,font: nil,
10+
1011
color: '#000000',pointsize:,stroke: 'transparent',
1112
internal_label: '', rotation: nil,
1213
weight: nil, gravity: nil
1314
)
1415
super(owner.backend, abs_x, abs_y)
16+
1517
@text = text
1618
@owner = owner
1719
@font = font

lib/rubyplot/backend/magick_wrapper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def initialize
1616
@draw = Magick::Draw.new
1717
end
1818

19+
20+
1921
# Height in pixels of particular text.
2022
# @param text [String] Text to be measured.
2123
def text_height(text, font, font_size)

spec/spec_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
require 'fileutils'
22
require 'pry'
33
require 'rubyplot'
4+
require 'rspec'
5+
require 'rmagick'
46

57
SPEC_ROOT = File.dirname(__FILE__) + "/"
68
TEMP_DIR = SPEC_ROOT + "temp/"

0 commit comments

Comments
 (0)