quacky-charts 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -6,34 +6,30 @@ QuackyCharts is a graphing gem I'm working on. The goal is to easily create cha
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'quacky-charts'
9
+ gem 'quacky-charts'
10
10
 
11
11
  And then execute:
12
12
 
13
- $ bundle
13
+ $ bundle
14
14
 
15
- Or install it yourself as:
16
-
17
- $ gem install quacky-charts
18
-
19
- Install the needed JS files
15
+ Run this command to install the needed JS files:
20
16
 
21
17
  $ rails generate quacky:install
22
18
 
23
19
  ## Usage
24
20
 
25
- In app/assets/javascripts/application.js
21
+ Add these lines to app/assets/javascripts/application.js:
26
22
 
27
23
  //= require d3.v2.min
28
24
  //= require pie_charts.js
29
25
 
30
- In your controller
26
+ and to the controller:
31
27
 
32
- @generator = QuackyCharts::Builder.new
28
+ @chart = QuackyC::PieChartBuilder.new
33
29
 
34
- In your view
30
+ and finally, in the view:
35
31
 
36
- <%= @generator.pie_chart %>
32
+ <%= @chart.draw %>
37
33
 
38
34
  ## Contributing
39
35
 
@@ -0,0 +1,10 @@
1
+ module Quacky
2
+ class PieChartBuilder
3
+
4
+ # return a content tag that can be selected by the client-side, and drawn on
5
+ def draw
6
+ content_tag(:div, nil, :class => 'pie-chart')
7
+ end
8
+
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module QuackyCharts
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/quacky-charts.rb CHANGED
@@ -1,12 +1,13 @@
1
- require "quacky-charts/version"
2
- include ActionView::Helpers::TagHelper
3
-
4
- module QuackyCharts
5
- class Builder
1
+ require "quacky/version"
2
+ require "quacky/pie_chart_builder"
6
3
 
7
- def pie_chart
8
- content_tag(:div, nil, :class => 'pie-chart')
9
- end
4
+ include ActionView::Helpers::TagHelper
10
5
 
6
+ module Quacky
7
+
8
+ # return a content tag that can be selected by the client-side, and drawn on
9
+ def draw
10
+ content_tag(:div, nil, :class => 'pie-chart')
11
11
  end
12
+
12
13
  end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/quacky-charts/version', __FILE__)
2
+ require File.expand_path('../lib/quacky/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Travis Sheppard"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quacky-charts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,7 +27,8 @@ files:
27
27
  - lib/generators/quacky/templates/d3.v2.min.js
28
28
  - lib/generators/quacky/templates/pie_charts.js
29
29
  - lib/quacky-charts.rb
30
- - lib/quacky-charts/version.rb
30
+ - lib/quacky/pie_chart_builder.rb
31
+ - lib/quacky/version.rb
31
32
  - quacky-charts.gemspec
32
33
  homepage: ''
33
34
  licenses: []