yodeler 0.0.10 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +33 -0
  3. data/.gitignore +9 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +6 -0
  6. data/Gemfile +4 -0
  7. data/Guardfile +16 -0
  8. data/README.md +158 -67
  9. data/Rakefile +4 -21
  10. data/bin/console +14 -0
  11. data/bin/setup +7 -0
  12. data/lib/yodeler/adapter_not_registered_error.rb +14 -0
  13. data/lib/yodeler/adapters/http_adapter.rb +51 -0
  14. data/lib/yodeler/adapters/memory_adapter.rb +23 -0
  15. data/lib/yodeler/adapters/void_adapter.rb +10 -0
  16. data/lib/yodeler/client.rb +166 -0
  17. data/lib/yodeler/duplicate_endpoint_name_error.rb +9 -0
  18. data/lib/yodeler/endpoint.rb +35 -0
  19. data/lib/yodeler/metric.rb +36 -0
  20. data/lib/yodeler/version.rb +1 -1
  21. data/lib/yodeler.rb +41 -106
  22. data/yodeler.gemspec +29 -0
  23. metadata +44 -102
  24. data/MIT-LICENSE +0 -20
  25. data/app/assets/javascripts/yodeler/application.js +0 -13
  26. data/app/assets/stylesheets/yodeler/application.css +0 -13
  27. data/app/controllers/yodeler/application_controller.rb +0 -4
  28. data/app/helpers/yodeler/application_helper.rb +0 -4
  29. data/app/views/layouts/yodeler/application.html.erb +0 -14
  30. data/config/routes.rb +0 -2
  31. data/lib/generators/yodeler/USAGE +0 -2
  32. data/lib/generators/yodeler/install_generator.rb +0 -23
  33. data/lib/generators/yodeler/templates/initializer.rb +0 -7
  34. data/lib/generators/yodeler/templates/migration.rb +0 -50
  35. data/lib/tasks/yodeler_tasks.rake +0 -4
  36. data/lib/yodeler/configuration.rb +0 -12
  37. data/lib/yodeler/engine.rb +0 -10
  38. data/lib/yodeler/listens_to_yodeler.rb +0 -32
  39. data/lib/yodeler/models/event.rb +0 -17
  40. data/lib/yodeler/models/event_type.rb +0 -6
  41. data/lib/yodeler/models/event_types/base.rb +0 -59
  42. data/lib/yodeler/models/event_types/noop_event_type.rb +0 -12
  43. data/lib/yodeler/models/notification.rb +0 -30
  44. data/lib/yodeler/models/subscription.rb +0 -9
@@ -0,0 +1,9 @@
1
+ module Yodeler
2
+ class DuplicateEndpointNameError < StandardError
3
+ attr_reader :name
4
+ def initialize(name:)
5
+ @name = name
6
+ super("An instance of Yodeler::Endpoint named '#{name}' already exists.")
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,35 @@
1
+ module Yodeler
2
+ class Endpoint
3
+ attr_reader :name
4
+ attr_reader :adapter
5
+
6
+ def initialize(name)
7
+ @name = name
8
+ yield(self) if block_given?
9
+ end
10
+
11
+ # Set the adapter this endpoint will use
12
+ #
13
+ # @example
14
+ # endpoint = Yodeler::Endpoint.new(:dashboard)
15
+ # endpoint.use(:http)
16
+ #
17
+ # @example
18
+ # endpoint = Yodeler::Endpoint.new(:dashboard)
19
+ # endpoint.use(:http) do |http|
20
+ # #your adapter setup here
21
+ # end
22
+ #
23
+ # @param [Symbol] name the registered name of the adapter
24
+ # @return [~Yodeler::Adapters::Base] yodeler adapter
25
+ def use(name)
26
+ @adapter = Yodeler.registered_adapters(name).new
27
+ yield(@adapter) if block_given?
28
+ @adapter
29
+ end
30
+
31
+ def adapter
32
+ @adapter
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,36 @@
1
+ class Yodeler::Metric
2
+ attr_reader :type, :value
3
+ attr_reader :sample_rate, :tags, :prefix
4
+ attr_reader :options
5
+
6
+ def initialize(type, name, value, opts={})
7
+ @type = type
8
+ @name = name
9
+ @value = value
10
+ @prefix = opts.delete(:prefix)
11
+ @sample_rate = opts.delete(:sample_rate)
12
+ @options = opts
13
+ end
14
+
15
+ def name
16
+ @prefix ? [@prefix, @name].join('.') : @name
17
+ end
18
+
19
+ # @return [Boolean] Should this metric be sampled
20
+ def sample?
21
+ @_sample ||= !(rand()> @sample_rate)
22
+ end
23
+
24
+ def to_hash
25
+ hash = {
26
+ name: name,
27
+ type: @type,
28
+ value: @value,
29
+ }
30
+
31
+ hash[:tags] = options[:tags] if options[:tags] && options[:tags].any?
32
+ hash[:hostname] = options[:hostname] if options[:hostname]
33
+
34
+ hash
35
+ end
36
+ end
@@ -1,3 +1,3 @@
1
1
  module Yodeler
2
- VERSION = "0.0.10"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/yodeler.rb CHANGED
@@ -1,122 +1,57 @@
1
- # encoding: utf-8
2
- require "yodeler/engine"
3
- require "yodeler/listens_to_yodeler"
1
+ require "yaml"
2
+ require 'forwardable'
4
3
 
5
- module Yodeler
6
- autoload :Configuration, 'yodeler/configuration'
7
- autoload :EventType, 'yodeler/models/event_type'
8
- autoload :Event, 'yodeler/models/event'
9
- autoload :Subscription, 'yodeler/models/subscription'
10
- autoload :Notification, 'yodeler/models/notification'
11
- autoload :ListensToYodeler, 'yodeler/listens_to_yodeler'
12
- autoload :EventType, 'yodeler/models/event_type'
13
-
14
- mattr_accessor :registrations
15
- self.registrations = {}
16
-
17
- # Configuring the yodeler gem
18
- def self.configuration
19
- @configuration ||= Configuration.new
20
- end
21
-
22
- def self.configure
23
- yield configuration
24
- end
4
+ require "yodeler/version"
5
+ require "yodeler/endpoint"
6
+ require "yodeler/client"
7
+ require "yodeler/metric"
25
8
 
26
- # Set the ActiveRecord table name prefix to yodeler_
27
- #
28
- # This makes 'events' into 'yodeler_events' and also respects any
29
- # 'global' table_name_prefix set on ActiveRecord::Base.
30
- def self.table_name_prefix
31
- "#{ActiveRecord::Base.table_name_prefix}yodeler_"
32
- end
9
+ require "yodeler/duplicate_endpoint_name_error"
10
+ require "yodeler/adapter_not_registered_error"
33
11
 
34
- # Creates an event_type model e.g.: Yodeler::#{event_type}EventType < Yodeler::EventType::Base
35
- #
36
- # @note
37
- # you could also create your own class inheriting #{Yodeler::EventType::Base}
38
- def self.register(event_type,&block)
39
- event_type_klass = Yodeler.define_event_type(event_type)
40
-
41
- if block_given?
42
- yield event_type_klass.configuration
43
- end
44
-
45
- # keep track of the registrations
46
- Yodeler.registrations[event_type] = event_type_klass
47
- event_type_klass
48
- end
49
-
50
- # Dispatches an event
51
- # @param [Symbol] event_type the registered event type
52
- # @param [Hash] payload a hash of values to serialize with the event
53
- #
54
- def self.dispatch(event_type, payload={})
55
- event_type_klass = Yodeler.registrations[event_type]
56
-
57
- # If the class wasn't registered dispatch the default class noop
58
- if event_type_klass.nil?
59
- # Register it the first time
60
- Yodeler.register(:noop) if Yodeler.registrations[:noop].nil?
61
-
62
- event_type_klass = Yodeler::EventType::NoopEventType
12
+ module Yodeler
13
+ class << self
14
+ extend Forwardable
15
+ def_delegators :@client, :gauge, :increment, :timing, :publish
16
+
17
+ #
18
+ # @private
19
+ def setup!
20
+ @client = nil
21
+ @registered_adapters = {}
63
22
  end
64
23
 
65
- started_at = nil
66
- finished_at = nil
67
-
68
- if block_given?
69
- started_at = Time.now
70
- yield payload
71
- finished_at = Time.now
24
+ def register_adapter(name,klass)
25
+ @registered_adapters[name] = klass
72
26
  end
73
27
 
74
- event_type_klass.yodel!({
75
- started_at: started_at,
76
- finished_at: finished_at,
77
- payload: payload
78
- })
79
- end
80
-
81
- # Clears all the registrations and removes the EventType classes
82
- def self.flush_registrations!
83
- Yodeler.registrations.keys.each do |event_type|
84
- Yodeler.undefine_event_type(event_type)
28
+ #
29
+ # @private
30
+ def registered_adapters(name)
31
+ klass = @registered_adapters[name]
32
+ if !klass
33
+ raise AdapterNotRegisteredError.new(name: name)
34
+ end
35
+ @registered_adapters[name]
85
36
  end
86
- Yodeler.registrations = {}
87
- end
88
37
 
89
- private
90
- def self.event_type_class_name(event_type)
91
- "#{event_type.to_s.classify}EventType"
38
+ # @private
39
+ def reset!
40
+ setup!
92
41
  end
93
42
 
94
- def self.undefine_event_type(event_type)
95
- event_klass = Yodeler.registrations[event_type]
96
- if event_klass && ( defined?( event_klass ) == 'constant' )
97
- Yodeler::EventType.instance_eval{
98
- remove_const( event_type.to_s.classify.to_sym )
99
- }
100
- end
43
+ def client
44
+ @client
101
45
  end
102
46
 
103
- def self.define_event_type(event_type)
104
- undefine_event_type(event_type)
105
-
106
- # Define an ancestor event type of Yodeler::EventType::Base and
107
- # add AS Configurable to it
108
- new_event_type_class = Class.new(Yodeler::EventType::Base) do
109
- end
110
-
111
- # Define the event type class, e.g.: Yodeler::EventType::UserViewedEventType
112
- Yodeler::EventType.const_set(Yodeler.event_type_class_name(event_type), new_event_type_class)
47
+ def configure
48
+ @client = Yodeler::Client.new
49
+ yield @client
50
+ @client
113
51
  end
114
-
115
- # def self.cleanup!(hard=false)
116
- # # defunct or delete any event_types, et al that aren't currently registered
117
- # if hard
118
- # else
119
- # end
120
- # end
52
+ end
121
53
  end
122
54
 
55
+ Yodeler.setup!
56
+ require "yodeler/adapters/memory_adapter"
57
+ require "yodeler/adapters/http_adapter"
data/yodeler.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'yodeler/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "yodeler"
8
+ spec.version = Yodeler::VERSION
9
+ spec.authors = ["Cory O'Daniel"]
10
+ spec.email = ["github@coryodaniel.com"]
11
+ spec.description = "A generic instrumentation library thats supports reporting to multiple endpoints via pluggable backend adapters."
12
+ spec.summary = "A generic instrumentation library thats supports reporting to multiple endpoints via pluggable backend adapters. Spoutin' off noise to whoever is listening."
13
+ spec.homepage = "http://github.com/coryodaniel/yodeler"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ spec.bindir = "exe"
17
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency "http"
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec"
25
+ spec.add_development_dependency "webmock"
26
+ spec.add_development_dependency "rspec-mocks"
27
+ spec.add_development_dependency "guard-rspec"
28
+ spec.add_development_dependency "codeclimate-test-reporter"
29
+ end
metadata CHANGED
@@ -1,79 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yodeler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cory O'Daniel
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2015-02-26 00:00:00.000000000 Z
11
+ date: 2016-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">"
18
- - !ruby/object:Gem::Version
19
- version: 4.0.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">"
25
- - !ruby/object:Gem::Version
26
- version: 4.0.0
27
- - !ruby/object:Gem::Dependency
28
- name: sqlite3
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: railties
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rspec-rails
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: factory_girl_rails
14
+ name: http
71
15
  requirement: !ruby/object:Gem::Requirement
72
16
  requirements:
73
17
  - - ">="
74
18
  - !ruby/object:Gem::Version
75
19
  version: '0'
76
- type: :development
20
+ type: :runtime
77
21
  prerelease: false
78
22
  version_requirements: !ruby/object:Gem::Requirement
79
23
  requirements:
@@ -81,35 +25,35 @@ dependencies:
81
25
  - !ruby/object:Gem::Version
82
26
  version: '0'
83
27
  - !ruby/object:Gem::Dependency
84
- name: generator_spec
28
+ name: bundler
85
29
  requirement: !ruby/object:Gem::Requirement
86
30
  requirements:
87
- - - ">="
31
+ - - "~>"
88
32
  - !ruby/object:Gem::Version
89
- version: '0'
33
+ version: '1.10'
90
34
  type: :development
91
35
  prerelease: false
92
36
  version_requirements: !ruby/object:Gem::Requirement
93
37
  requirements:
94
- - - ">="
38
+ - - "~>"
95
39
  - !ruby/object:Gem::Version
96
- version: '0'
40
+ version: '1.10'
97
41
  - !ruby/object:Gem::Dependency
98
- name: guard-rspec
42
+ name: rake
99
43
  requirement: !ruby/object:Gem::Requirement
100
44
  requirements:
101
- - - ">="
45
+ - - "~>"
102
46
  - !ruby/object:Gem::Version
103
- version: '0'
47
+ version: '10.0'
104
48
  type: :development
105
49
  prerelease: false
106
50
  version_requirements: !ruby/object:Gem::Requirement
107
51
  requirements:
108
- - - ">="
52
+ - - "~>"
109
53
  - !ruby/object:Gem::Version
110
- version: '0'
54
+ version: '10.0'
111
55
  - !ruby/object:Gem::Dependency
112
- name: guard-bundler
56
+ name: rspec
113
57
  requirement: !ruby/object:Gem::Requirement
114
58
  requirements:
115
59
  - - ">="
@@ -123,7 +67,7 @@ dependencies:
123
67
  - !ruby/object:Gem::Version
124
68
  version: '0'
125
69
  - !ruby/object:Gem::Dependency
126
- name: shoulda-matchers
70
+ name: webmock
127
71
  requirement: !ruby/object:Gem::Requirement
128
72
  requirements:
129
73
  - - ">="
@@ -137,7 +81,7 @@ dependencies:
137
81
  - !ruby/object:Gem::Version
138
82
  version: '0'
139
83
  - !ruby/object:Gem::Dependency
140
- name: simplecov
84
+ name: rspec-mocks
141
85
  requirement: !ruby/object:Gem::Requirement
142
86
  requirements:
143
87
  - - ">="
@@ -151,7 +95,7 @@ dependencies:
151
95
  - !ruby/object:Gem::Version
152
96
  version: '0'
153
97
  - !ruby/object:Gem::Dependency
154
- name: database_cleaner
98
+ name: guard-rspec
155
99
  requirement: !ruby/object:Gem::Requirement
156
100
  requirements:
157
101
  - - ">="
@@ -165,7 +109,7 @@ dependencies:
165
109
  - !ruby/object:Gem::Version
166
110
  version: '0'
167
111
  - !ruby/object:Gem::Dependency
168
- name: byebug
112
+ name: codeclimate-test-reporter
169
113
  requirement: !ruby/object:Gem::Requirement
170
114
  requirements:
171
115
  - - ">="
@@ -178,38 +122,35 @@ dependencies:
178
122
  - - ">="
179
123
  - !ruby/object:Gem::Version
180
124
  version: '0'
181
- description:
125
+ description: A generic instrumentation library thats supports reporting to multiple
126
+ endpoints via pluggable backend adapters.
182
127
  email:
183
- - yodel@coryodaniel.com
128
+ - github@coryodaniel.com
184
129
  executables: []
185
130
  extensions: []
186
131
  extra_rdoc_files: []
187
132
  files:
188
- - MIT-LICENSE
133
+ - ".codeclimate.yml"
134
+ - ".gitignore"
135
+ - ".rspec"
136
+ - ".travis.yml"
137
+ - Gemfile
138
+ - Guardfile
189
139
  - README.md
190
140
  - Rakefile
191
- - app/assets/javascripts/yodeler/application.js
192
- - app/assets/stylesheets/yodeler/application.css
193
- - app/controllers/yodeler/application_controller.rb
194
- - app/helpers/yodeler/application_helper.rb
195
- - app/views/layouts/yodeler/application.html.erb
196
- - config/routes.rb
197
- - lib/generators/yodeler/USAGE
198
- - lib/generators/yodeler/install_generator.rb
199
- - lib/generators/yodeler/templates/initializer.rb
200
- - lib/generators/yodeler/templates/migration.rb
201
- - lib/tasks/yodeler_tasks.rake
141
+ - bin/console
142
+ - bin/setup
202
143
  - lib/yodeler.rb
203
- - lib/yodeler/configuration.rb
204
- - lib/yodeler/engine.rb
205
- - lib/yodeler/listens_to_yodeler.rb
206
- - lib/yodeler/models/event.rb
207
- - lib/yodeler/models/event_type.rb
208
- - lib/yodeler/models/event_types/base.rb
209
- - lib/yodeler/models/event_types/noop_event_type.rb
210
- - lib/yodeler/models/notification.rb
211
- - lib/yodeler/models/subscription.rb
144
+ - lib/yodeler/adapter_not_registered_error.rb
145
+ - lib/yodeler/adapters/http_adapter.rb
146
+ - lib/yodeler/adapters/memory_adapter.rb
147
+ - lib/yodeler/adapters/void_adapter.rb
148
+ - lib/yodeler/client.rb
149
+ - lib/yodeler/duplicate_endpoint_name_error.rb
150
+ - lib/yodeler/endpoint.rb
151
+ - lib/yodeler/metric.rb
212
152
  - lib/yodeler/version.rb
153
+ - yodeler.gemspec
213
154
  homepage: http://github.com/coryodaniel/yodeler
214
155
  licenses: []
215
156
  metadata: {}
@@ -228,9 +169,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
169
  - !ruby/object:Gem::Version
229
170
  version: '0'
230
171
  requirements: []
231
- rubyforge_project: yodeler
232
- rubygems_version: 2.4.3
172
+ rubyforge_project:
173
+ rubygems_version: 2.4.8
233
174
  signing_key:
234
175
  specification_version: 4
235
- summary: Subscribable database-stored event notifications for Rails
176
+ summary: A generic instrumentation library thats supports reporting to multiple endpoints
177
+ via pluggable backend adapters. Spoutin' off noise to whoever is listening.
236
178
  test_files: []
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright 2014 YOURNAME
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,13 +0,0 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
9
- //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require_tree .
@@ -1,13 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
10
- *
11
- *= require_self
12
- *= require_tree .
13
- */
@@ -1,4 +0,0 @@
1
- module Yodeler
2
- class ApplicationController < ActionController::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module Yodeler
2
- module ApplicationHelper
3
- end
4
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Yodeler</title>
5
- <%= stylesheet_link_tag "yodeler/application", media: "all" %>
6
- <%= javascript_include_tag "yodeler/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
data/config/routes.rb DELETED
@@ -1,2 +0,0 @@
1
- Yodeler::Engine.routes.draw do
2
- end
@@ -1,2 +0,0 @@
1
- Description:
2
- Generates (but does not run) a migration to add yodeler tables and an initializer.
@@ -1,23 +0,0 @@
1
- require 'rails/generators'
2
- require 'rails/generators/active_record'
3
-
4
- module Yodeler
5
- class InstallGenerator < ::Rails::Generators::Base
6
- include ::Rails::Generators::Migration
7
-
8
- source_root File.expand_path('../templates', __FILE__)
9
- desc 'Generates (but does not run) a migration to add yodeler tables and an initializer.'
10
-
11
- def create_migration_file
12
- migration_template 'migration.rb', 'db/migrate/create_yodeler_tables.rb'
13
- end
14
-
15
- def create_initializer
16
- copy_file 'initializer.rb', 'config/initializers/yodeler.rb'
17
- end
18
-
19
- def self.next_migration_number(dirname)
20
- ::ActiveRecord::Generators::Base.next_migration_number(dirname)
21
- end
22
- end
23
- end
@@ -1,7 +0,0 @@
1
- Yodeler.configure do |config|
2
- # Override the default states
3
- # config.default_states = {
4
- # unread: 0,
5
- # read: 1
6
- # }
7
- end