svg_charts 1.02 → 1.03

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d874486fa11cee97dfcf24eec8fc7fd59d863e2b
4
+ data.tar.gz: ee754f9799396f67d33f40089f3456cde0487c67
5
+ SHA512:
6
+ metadata.gz: 211ecda3839458dc69f26874a20393c6b558afb12c1caf9354ae4e7b98c470d94d0e38914aaf70be6748f00697da559ef32011bd402c1104736a3f78959d64de
7
+ data.tar.gz: 7cb0d35a57e66c08fcab6dfc5bab19291b96fce03b1ccb0493ac26807cf7fe7c5e79bd0c33cd2733706ce4313e85c919a07575697116dd6d26a7ec411ab01ec5
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "http://rubygems.org"
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,24 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ svg_charts (1.0.3)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.2.1)
10
+ rspec (2.13.0)
11
+ rspec-core (~> 2.13.0)
12
+ rspec-expectations (~> 2.13.0)
13
+ rspec-mocks (~> 2.13.0)
14
+ rspec-core (2.13.1)
15
+ rspec-expectations (2.13.0)
16
+ diff-lcs (>= 1.1.3, < 2.0)
17
+ rspec-mocks (2.13.0)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ rspec
24
+ svg_charts!
@@ -1,52 +1,56 @@
1
- = SVGCharts
1
+ # SVGCharts
2
2
 
3
3
  Draw charts using SVG.
4
4
 
5
- == Installation
5
+ ## Installation
6
6
 
7
7
  gem install svg_charts
8
8
 
9
- == Usage
9
+ ## Usage
10
10
 
11
- # file.rb
12
- require "rubygems"
13
- require "svg_charts"
11
+ ~~~.ruby
12
+ #=> file.rb
14
13
 
15
- @line = SVGCharts::Line.new({
16
- :height => 300,
17
- :width => 300,
18
- :y_retreat => 20,
19
- :x_retreat => 20
20
- })
14
+ require "rubygems"
15
+ require "svg_charts"
21
16
 
22
- @scale = @line.scale({
23
- :y_label => "Numbers",
24
- :x_label => "Letters"
25
- })
17
+ line = SVGCharts::Line.new({
18
+ :height => 300,
19
+ :width => 300,
20
+ :y_retreat => 20,
21
+ :x_retreat => 20
22
+ })
26
23
 
27
- @chart << @line.draw({
28
- :scale => ["A", "B", "C"],
29
- :data => [10, 20, 30],
30
- :data_color => "#000000",
31
- :show_scale => true,
32
- :show_dashed => true
33
- })
24
+ @scale = line.scale({
25
+ :y_label => "Numbers",
26
+ :x_label => "Letters"
27
+ })
34
28
 
35
- # file.html
36
- <svg width="680" height="350">
37
- <%= @scale %>
38
- <%= @chart %>
39
- </svg>
29
+ @chart = line.draw({
30
+ :scale => ["A", "B", "C"],
31
+ :data => [10, 20, 30],
32
+ :data_color => "#000000",
33
+ :show_scale => true,
34
+ :show_dashed => true
35
+ })
36
+ ~~~
40
37
 
41
- == Maintainer
38
+ # file.erb
42
39
 
43
- * Rogério Zambon (http://rogeriozambon.com)
40
+ <svg width="680" height="350">
41
+ <%= @scale %>
42
+ <%= @chart %>
43
+ </svg>
44
44
 
45
- == Collaborators
45
+ ## Maintainer
46
+
47
+ * Rogério Zambon (http://rogerio.me)
48
+
49
+ ## Collaborators
46
50
 
47
51
  * André Ronix (http://www.linkedin.com/pub/andr%C3%A9-s-ronix/27/212/3b2): Generated the coordinates calc.
48
52
 
49
- == License
53
+ ## License
50
54
 
51
55
  (The MIT License)
52
56
 
data/lib/charts/line.rb CHANGED
@@ -69,7 +69,7 @@ module SVGCharts
69
69
  :y1 => coordinate[2],
70
70
  :y2 => coordinate[3],
71
71
  :line_width => 1,
72
- :color => "#999"
72
+ :color => options[:data_color]
73
73
  })
74
74
 
75
75
  if options[:show_dashed]
@@ -0,0 +1,3 @@
1
+ module SVGCharts
2
+ VERSION = "1.03"
3
+ end
data/lib/svg_charts.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  require "charts/elements"
2
2
  require "charts/line"
3
+ require "charts/version"
data/spec/spec_helper.rb CHANGED
@@ -1 +1,6 @@
1
- Dir[File.expand_path("../../lib/charts", __FILE__) + "/*.rb"].each { |file| require file }
1
+ require "bundler/setup"
2
+ Bundler.require :default, :development
3
+
4
+ require "svg_charts"
5
+ require "charts/elements"
6
+ require "charts/line"
data/svg_charts.gemspec CHANGED
@@ -1,24 +1,19 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "charts/version"
4
+
2
5
  Gem::Specification.new do |s|
3
- s.authors = ["Rogério Zambon"]
4
- s.date = "2013-01-28"
5
- s.description = "Draw charts using SVG."
6
- s.email = "rogeriozambon@gmail.com"
7
- s.files = [
8
- ".rspec",
9
- "lib/charts/elements.rb",
10
- "lib/charts/line.rb",
11
- "lib/svg_charts.rb",
12
- "spec/spec_helper.rb",
13
- "spec/charts/line_spec.rb",
14
- "VERSION",
15
- "README.rdoc",
16
- "svg_charts.gemspec"
17
- ]
18
- s.homepage = "http://github.com/rogeriozambon/svg_charts"
19
- s.name = "svg_charts"
6
+ s.name = "svg_charts"
7
+ s.version = SVGCharts::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Rogério Zambon"]
10
+ s.email = ["rogeriozambon@gmail.com"]
11
+ s.homepage = "http://github.com/rogeriozambon/svg_charts"
12
+ s.summary = "Draw charts using SVG."
13
+ s.description = s.summary
14
+
15
+ s.files = `git ls-files`.split("\n")
20
16
  s.require_paths = ["lib"]
21
- s.required_rubygems_version = Gem::Requirement.new(">= 1.8.23")
22
- s.summary = s.description
23
- s.version = "1.02"
17
+
18
+ s.add_development_dependency "rspec"
24
19
  end
metadata CHANGED
@@ -1,53 +1,68 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svg_charts
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.02'
5
- prerelease:
4
+ version: '1.03'
6
5
  platform: ruby
7
6
  authors:
8
7
  - Rogério Zambon
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-28 00:00:00.000000000 Z
13
- dependencies: []
11
+ date: 2013-03-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
14
27
  description: Draw charts using SVG.
15
- email: rogeriozambon@gmail.com
28
+ email:
29
+ - rogeriozambon@gmail.com
16
30
  executables: []
17
31
  extensions: []
18
32
  extra_rdoc_files: []
19
33
  files:
20
34
  - .rspec
35
+ - Gemfile
36
+ - Gemfile.lock
37
+ - README.md
21
38
  - lib/charts/elements.rb
22
39
  - lib/charts/line.rb
40
+ - lib/charts/version.rb
23
41
  - lib/svg_charts.rb
24
- - spec/spec_helper.rb
25
42
  - spec/charts/line_spec.rb
26
- - VERSION
27
- - README.rdoc
43
+ - spec/spec_helper.rb
28
44
  - svg_charts.gemspec
29
45
  homepage: http://github.com/rogeriozambon/svg_charts
30
46
  licenses: []
47
+ metadata: {}
31
48
  post_install_message:
32
49
  rdoc_options: []
33
50
  require_paths:
34
51
  - lib
35
52
  required_ruby_version: !ruby/object:Gem::Requirement
36
- none: false
37
53
  requirements:
38
- - - ! '>='
54
+ - - '>='
39
55
  - !ruby/object:Gem::Version
40
56
  version: '0'
41
57
  required_rubygems_version: !ruby/object:Gem::Requirement
42
- none: false
43
58
  requirements:
44
- - - ! '>='
59
+ - - '>='
45
60
  - !ruby/object:Gem::Version
46
- version: 1.8.23
61
+ version: '0'
47
62
  requirements: []
48
63
  rubyforge_project:
49
- rubygems_version: 1.8.23
64
+ rubygems_version: 2.0.0
50
65
  signing_key:
51
- specification_version: 3
66
+ specification_version: 4
52
67
  summary: Draw charts using SVG.
53
68
  test_files: []
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.02