Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
0b973b8
rubocopping
arzoo14 Dec 14, 2018
f60f6a2
Merge branch 'integration' into first_branch
arzoo14 Dec 14, 2018
c27e84b
Merge branch 'integration' into first_branch
arzoo14 Dec 15, 2018
c713e3a
Update rubyplot.rb
arzoo14 Dec 15, 2018
d50db16
Update rubyplot.rb
arzoo14 Dec 15, 2018
d1610f8
setup_travis_CI
arzoo14 Dec 15, 2018
ad3863a
Merge branch 'first_branch' of https://github.com/arzoo14/rubyplot in…
arzoo14 Dec 15, 2018
0925590
setup_tavis_ci
arzoo14 Dec 15, 2018
9f897c0
Merge branch 'integration' into first_branch
arzoo14 Dec 16, 2018
8f8a188
Merge branch 'integration' into first_branch
arzoo14 Dec 18, 2018
ea5bd22
new_changes
arzoo14 Dec 18, 2018
6bd229f
changes
arzoo14 Dec 18, 2018
e0b23d4
color_related
arzoo14 Dec 18, 2018
38e4ecd
Update color.rb
arzoo14 Dec 18, 2018
cab467d
changes
arzoo14 Dec 25, 2018
c250f0e
rubocop_offenses
arzoo14 Dec 25, 2018
82dd9f0
changes
arzoo14 Dec 25, 2018
1d845bf
fixed_rubocop_errors
arzoo14 Dec 25, 2018
7e4ceb0
travis_setup
arzoo14 Dec 25, 2018
7bce201
changes
arzoo14 Dec 25, 2018
3b37272
changes
arzoo14 Dec 25, 2018
849995d
changes
arzoo14 Dec 25, 2018
44f37e1
changes
arzoo14 Dec 25, 2018
36252c5
changes
arzoo14 Dec 26, 2018
25c69e0
chnages
arzoo14 Dec 26, 2018
38ae4f1
chnages
arzoo14 Dec 26, 2018
1029c7e
chnages
arzoo14 Dec 26, 2018
2539908
chnages
arzoo14 Dec 26, 2018
5778700
chnages
arzoo14 Dec 26, 2018
c04e6f6
chnages
arzoo14 Dec 26, 2018
67daaa8
chnages
arzoo14 Dec 26, 2018
7f3a5c7
chnages
arzoo14 Dec 26, 2018
aeda9a4
chnages
arzoo14 Dec 26, 2018
029d8ab
chnages
arzoo14 Dec 26, 2018
9ef2954
changes
arzoo14 Dec 27, 2018
2d171ce
added
arzoo14 Dec 27, 2018
5970a21
added
arzoo14 Dec 27, 2018
8a2cb38
added
arzoo14 Dec 28, 2018
0cbc44f
added
arzoo14 Dec 28, 2018
aae1dc2
added
arzoo14 Dec 28, 2018
2d01556
added
arzoo14 Dec 28, 2018
5c0c73e
changes
arzoo14 Dec 28, 2018
99597eb
changes
arzoo14 Dec 28, 2018
7454c80
changes
arzoo14 Dec 28, 2018
42094ec
changes
arzoo14 Dec 28, 2018
5a37027
changes
arzoo14 Dec 28, 2018
969e2a8
changes
arzoo14 Dec 28, 2018
396b9fc
changes
arzoo14 Dec 28, 2018
c984c95
changes
arzoo14 Dec 28, 2018
c6e088a
changess
arzoo14 Dec 28, 2018
b1dc9b4
final_changes
arzoo14 Dec 31, 2018
48a5c46
final changes
arzoo14 Dec 31, 2018
b1b7dd4
final changes
arzoo14 Dec 31, 2018
3aa66a4
final changes
arzoo14 Dec 31, 2018
ce48e81
final changes
arzoo14 Dec 31, 2018
e2e46b2
final changes
arzoo14 Dec 31, 2018
2a60a31
Update magick_wrapper.rb
arzoo14 Dec 31, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language:
ruby

rvm:
- '2.0'
- '2.1'
- '2.2'
- '2.3.0'
- '2.4.0'

script:
- bundle exec rspec
- bundle exec rubocop

install:
- gem install bundler
- gem install rainbow -v '2.2.1'
- bundle install
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
source 'https://rubygems.org'

gemspec

group :test do
gem 'rake'
gem 'rspec'
end
15 changes: 14 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
require "bundler/gem_tasks"
require "rake"

require 'bundler/setup'
require 'rubygems/tasks'
Gem::Tasks.new

require 'rspec/core/rake_task'
require 'rake/extensiontask'
RSpec::Core::RakeTask.new

require 'rubocop/rake_task'
RuboCop::RakeTask.new

desc 'Default: run unit specs.'
task :default => %w[spec rubocop]

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

Expand Down
3 changes: 1 addition & 2 deletions lib/rubyplot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
require 'rubyplot/subplot'
require 'rubyplot/spi'

require 'grruby.so'
require 'rubyplot/gr_wrapper'

module Rubyplot
def self.backend
b = ENV['RUBYPLOT_BACKEND']
return b.to_sym if %w[magick gr].include?(b)
return b.to_sym if %w[magick ].include?(b)

:magick
end
Expand Down
2 changes: 2 additions & 0 deletions lib/rubyplot/artist/axes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,12 @@ def with_backend(plot_type, *args)

# Figure out the co-ordinates of the title text w.r.t Axes.
def configure_title

@texts << Rubyplot::Artist::Text.new(
@title, self, abs_x: abs_x + width / 2, abs_y: abs_y + @title_margin,
font: @font, color: @font_color,
pointsize: @title_font_size, internal_label: 'axes title.'

)
end

Expand Down
2 changes: 2 additions & 0 deletions lib/rubyplot/artist/axis/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ def initialize axes
@lines = []
end


def draw
configure_title
@lines.each(&:draw)
@texts.each(&:draw)
end

end
# class Base
end
Expand Down
2 changes: 2 additions & 0 deletions lib/rubyplot/artist/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ class Text < Artist::Base

# rubocop:disable Metrics/ParameterLists
def initialize(text, owner, abs_x:, abs_y:,font: nil,

color: '#000000',pointsize:,stroke: 'transparent',
internal_label: '', rotation: nil,
weight: nil, gravity: nil
)
super(owner.backend, abs_x, abs_y)

@text = text
@owner = owner
@font = font
Expand Down
2 changes: 2 additions & 0 deletions lib/rubyplot/backend/magick_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def initialize
@draw = Magick::Draw.new
end



# Height in pixels of particular text.
# @param text [String] Text to be measured.
def text_height(text, font, font_size)
Expand Down
2 changes: 0 additions & 2 deletions spec/axes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -484,5 +484,3 @@
end # context "#x_ticks="
end # Rubyplot::Axes
end # describe backends


2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require 'fileutils'
require 'pry'
require 'rubyplot'
require 'rspec'
require 'rmagick'

TEMP_DIR = "temp/"
FIXTURES_DIR = "fixtures/"
Expand Down