Class: Gitlab::SnowplowEventDefinitionGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Gitlab::SnowplowEventDefinitionGenerator
- Defined in:
- lib/generators/gitlab/snowplow_event_definition_generator.rb
Constant Summary collapse
- CE_DIR =
'config/events'
- EE_DIR =
'ee/config/events'
Instance Method Summary collapse
- #create_event_file ⇒ Object
- #distributions ⇒ Object
- #ee? ⇒ Boolean
- #event_action ⇒ Object
- #event_category ⇒ Object
- #milestone ⇒ Object
Instance Method Details
#create_event_file ⇒ Object
18 19 20 21 22 |
# File 'lib/generators/gitlab/snowplow_event_definition_generator.rb', line 18 def create_event_file raise "Event definition already exists at #{file_path}" if definition_exists? template "event_definition.yml", file_path, force: false end |
#distributions ⇒ Object
24 25 26 |
# File 'lib/generators/gitlab/snowplow_event_definition_generator.rb', line 24 def distributions (ee? ? ['- ee'] : ['- ce', '- ee']).join("\n") end |
#ee? ⇒ Boolean
40 41 42 |
# File 'lib/generators/gitlab/snowplow_event_definition_generator.rb', line 40 def ee? [:ee] end |
#event_action ⇒ Object
32 33 34 |
# File 'lib/generators/gitlab/snowplow_event_definition_generator.rb', line 32 def event_action [:action] end |
#event_category ⇒ Object
28 29 30 |
# File 'lib/generators/gitlab/snowplow_event_definition_generator.rb', line 28 def event_category [:category] end |