compendium-amcharts 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YmEwMDIzOTIxNjliZjgwMTEzM2EyODY5OGMxYzAxZDViNDEzNDYyYQ==
5
+ data.tar.gz: !binary |-
6
+ YjIxNzM4ZDM4OTU4ZDc0MDRiNTNkNjU3MWFmMGZjNzBmZDVjZjM5ZA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NDc1ODE4ZThiZmVmMGZmZDkzODM4ZjNmZjIyNzIxMTEzOTc5MzY3MzYzOWFh
10
+ NWViZDk5OTE2OWQ3MmMxOGRmOTNlMzcwNzRiOTY2YzdlZWVkM2U2MDM4YTk3
11
+ NTYzNDI0MjRlNTAwZTcyYTBiYjIxYmJjN2RlMWE0NmQzZjE4ZjE=
12
+ data.tar.gz: !binary |-
13
+ NmQ1NjAxNzlkYzY5YjhiYzEzOTUwMzVjYzAyYmQxM2VjOGE2ODc1NDFkN2Q1
14
+ MzU2OWI4ZWJiYzE2YTMxMDg3YTZhODEzYjA3YzE4OGVlMTRjZWUxODQzODk3
15
+ MzdkYTZhNWFlMTU3MGU2OTA4YWI2NDdkNDI5MDdhMDcwNDU2MmY=
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .idea
6
+ .yardoc
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in compendium-amcharts.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Daniel Vandersluis
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,36 @@
1
+ # Compendium::Amcharts
2
+
3
+ AmCharts.rb charting provider for Compendium reports.
4
+
5
+ ## Usage
6
+
7
+ This gem adds amcharts.rb as a provider for rendering charts in Compendium. If multiple providers are loaded,
8
+ AmCharts.rb can be forced by adding the following to an initializer:
9
+
10
+ ```ruby
11
+ Compendium.configure do |config|
12
+ config.chart_provider = :AmCharts
13
+ end
14
+ ```
15
+
16
+ ## Installation
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ gem 'compendium-amcharts'
21
+
22
+ And then execute:
23
+
24
+ $ bundle
25
+
26
+ Or install it yourself as:
27
+
28
+ $ gem install compendium-amcharts
29
+
30
+ ## Contributing
31
+
32
+ 1. Fork it
33
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
34
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
35
+ 4. Push to the branch (`git push origin my-new-feature`)
36
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'compendium/amcharts/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "compendium-amcharts"
8
+ spec.version = Compendium::AmCharts::VERSION
9
+ spec.authors = ["Daniel Vandersluis"]
10
+ spec.email = ["dvandersluis@selfmgmt.com"]
11
+ spec.description = %q{AmCharts.rb provider for Compendium reports}
12
+ spec.summary = %q{AmCharts.rb provider for Compendium reports}
13
+ spec.homepage = "https://github.com/dvandersluis/compendium-amcharts"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_dependency 'amcharts.rb', '>= 3.4.7.1'
24
+ spec.add_dependency 'compendium', '>= 1.1.0'
25
+ end
@@ -0,0 +1,17 @@
1
+ require 'compendium/amcharts/version'
2
+ require 'amcharts.rb'
3
+ require 'compendium'
4
+ require 'compendium/abstract_chart_provider'
5
+
6
+ module Compendium
7
+ module ChartProvider
8
+ autoload :AmCharts, 'compendium/chart_provider/amcharts'
9
+ end
10
+
11
+ class AbstractChartProvider
12
+ def self.find_chart_provider
13
+ return :AmCharts if defined?(AmCharts)
14
+ super
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ module Compendium
2
+ module AmCharts
3
+ VERSION = "1.0.1"
4
+ end
5
+ end
@@ -0,0 +1,33 @@
1
+ require 'amcharts.rb'
2
+
3
+ module Compendium
4
+ module ChartProvider
5
+ # Uses the amcharts.rb gem to provide charting
6
+ class AmCharts < Compendium::AbstractChartProvider
7
+ def initialize(type, data_or_url, params = {}, &setup_proc)
8
+ if data_or_url.is_a?(String)
9
+ url = data_or_url
10
+
11
+ @chart = chart_class(type).new([]) do |c|
12
+ c.data_source = { url: url, params: params || {}, method: 'POST' }
13
+ end
14
+
15
+ @chart.update_settings(&setup_proc)
16
+ else
17
+ data = data_or_url
18
+ @chart = chart_class(type).new(data, &setup_proc)
19
+ end
20
+ end
21
+
22
+ def render(template, container)
23
+ template.amchart(chart, container)
24
+ end
25
+
26
+ private
27
+
28
+ def chart_class(type)
29
+ ::AmCharts::Chart.const_get(type.to_s.titlecase)
30
+ end
31
+ end
32
+ end
33
+ end
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: compendium-amcharts
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Vandersluis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ type: :development
15
+ prerelease: false
16
+ name: bundler
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.3'
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ type: :development
29
+ prerelease: false
30
+ name: rake
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ! '>='
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ type: :runtime
43
+ prerelease: false
44
+ name: amcharts.rb
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: 3.4.7.1
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 3.4.7.1
55
+ - !ruby/object:Gem::Dependency
56
+ type: :runtime
57
+ prerelease: false
58
+ name: compendium
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: 1.1.0
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 1.1.0
69
+ description: AmCharts.rb provider for Compendium reports
70
+ email:
71
+ - dvandersluis@selfmgmt.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - .gitignore
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - compendium-amcharts.gemspec
82
+ - lib/compendium/amcharts.rb
83
+ - lib/compendium/amcharts/version.rb
84
+ - lib/compendium/chart_provider/amcharts.rb
85
+ homepage: https://github.com/dvandersluis/compendium-amcharts
86
+ licenses:
87
+ - MIT
88
+ metadata: {}
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.1.5
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: AmCharts.rb provider for Compendium reports
109
+ test_files: []
110
+ has_rdoc: