tennpipes-init 3.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +20 -0
  3. data/README.rdoc +163 -0
  4. data/Rakefile +1 -0
  5. data/bin/tennpipes-init +16 -0
  6. data/lib/tennpipes-init.rb +73 -0
  7. data/lib/tennpipes-init/command.rb +18 -0
  8. data/lib/tennpipes-init/generators/actions.rb +630 -0
  9. data/lib/tennpipes-init/generators/app.rb +75 -0
  10. data/lib/tennpipes-init/generators/app/app.rb.tt +72 -0
  11. data/lib/tennpipes-init/generators/app/app.rb.tt~ +72 -0
  12. data/lib/tennpipes-init/generators/cli.rb +57 -0
  13. data/lib/tennpipes-init/generators/component.rb +73 -0
  14. data/lib/tennpipes-init/generators/components/actions.rb +208 -0
  15. data/lib/tennpipes-init/generators/components/mocks/mocha.rb +10 -0
  16. data/lib/tennpipes-init/generators/components/mocks/rr.rb +13 -0
  17. data/lib/tennpipes-init/generators/components/orms/activerecord.rb +201 -0
  18. data/lib/tennpipes-init/generators/components/orms/couchrest.rb +55 -0
  19. data/lib/tennpipes-init/generators/components/orms/datamapper.rb +140 -0
  20. data/lib/tennpipes-init/generators/components/orms/dynamoid.rb +67 -0
  21. data/lib/tennpipes-init/generators/components/orms/minirecord.rb +165 -0
  22. data/lib/tennpipes-init/generators/components/orms/mongoid.rb +113 -0
  23. data/lib/tennpipes-init/generators/components/orms/mongomapper.rb +43 -0
  24. data/lib/tennpipes-init/generators/components/orms/mongomatic.rb +84 -0
  25. data/lib/tennpipes-init/generators/components/orms/ohm.rb +65 -0
  26. data/lib/tennpipes-init/generators/components/orms/ripple.rb +75 -0
  27. data/lib/tennpipes-init/generators/components/orms/sequel.rb +99 -0
  28. data/lib/tennpipes-init/generators/components/renderers/erb.rb +3 -0
  29. data/lib/tennpipes-init/generators/components/renderers/haml.rb +3 -0
  30. data/lib/tennpipes-init/generators/components/renderers/liquid.rb +4 -0
  31. data/lib/tennpipes-init/generators/components/renderers/slim.rb +3 -0
  32. data/lib/tennpipes-init/generators/components/scripts/dojo.rb +10 -0
  33. data/lib/tennpipes-init/generators/components/scripts/extcore.rb +10 -0
  34. data/lib/tennpipes-init/generators/components/scripts/jquery.rb +10 -0
  35. data/lib/tennpipes-init/generators/components/scripts/mootools.rb +10 -0
  36. data/lib/tennpipes-init/generators/components/scripts/prototype.rb +12 -0
  37. data/lib/tennpipes-init/generators/components/scripts/rightjs.rb +10 -0
  38. data/lib/tennpipes-init/generators/components/stylesheets/compass.rb +39 -0
  39. data/lib/tennpipes-init/generators/components/stylesheets/compass/application.scss +43 -0
  40. data/lib/tennpipes-init/generators/components/stylesheets/compass/partials/_base.scss +12 -0
  41. data/lib/tennpipes-init/generators/components/stylesheets/less.rb +25 -0
  42. data/lib/tennpipes-init/generators/components/stylesheets/sass.rb +15 -0
  43. data/lib/tennpipes-init/generators/components/stylesheets/scss.rb +16 -0
  44. data/lib/tennpipes-init/generators/components/tests/bacon.rb +103 -0
  45. data/lib/tennpipes-init/generators/components/tests/cucumber.rb +86 -0
  46. data/lib/tennpipes-init/generators/components/tests/minitest.rb +110 -0
  47. data/lib/tennpipes-init/generators/components/tests/riot.rb +117 -0
  48. data/lib/tennpipes-init/generators/components/tests/rspec.rb +111 -0
  49. data/lib/tennpipes-init/generators/components/tests/shoulda.rb +114 -0
  50. data/lib/tennpipes-init/generators/components/tests/steak.rb +114 -0
  51. data/lib/tennpipes-init/generators/controller.rb +77 -0
  52. data/lib/tennpipes-init/generators/helper.rb +50 -0
  53. data/lib/tennpipes-init/generators/mailer.rb +52 -0
  54. data/lib/tennpipes-init/generators/migration.rb +43 -0
  55. data/lib/tennpipes-init/generators/model.rb +113 -0
  56. data/lib/tennpipes-init/generators/plugin.rb +67 -0
  57. data/lib/tennpipes-init/generators/project.rb +160 -0
  58. data/lib/tennpipes-init/generators/project/config.ru +9 -0
  59. data/lib/tennpipes-init/generators/project/config/apps.rb.tt +35 -0
  60. data/lib/tennpipes-init/generators/project/config/boot.rb +49 -0
  61. data/lib/tennpipes-init/generators/project/public/favicon.ico +0 -0
  62. data/lib/tennpipes-init/generators/project/public/images/booking.com.png +0 -0
  63. data/lib/tennpipes-init/generators/project/public/images/causes.png +0 -0
  64. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_bg.jpg +0 -0
  65. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_bluelogo.png +0 -0
  66. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_bluelogo.svg +68 -0
  67. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_whitelogo.png +0 -0
  68. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_whitelogo.svg +65 -0
  69. data/lib/tennpipes-init/generators/project/public/images/forever21.png +0 -0
  70. data/lib/tennpipes-init/generators/project/public/images/icons/foundation-icons.eot +0 -0
  71. data/lib/tennpipes-init/generators/project/public/images/icons/foundation-icons.svg +970 -0
  72. data/lib/tennpipes-init/generators/project/public/images/icons/foundation-icons.ttf +0 -0
  73. data/lib/tennpipes-init/generators/project/public/images/icons/foundation-icons.woff +0 -0
  74. data/lib/tennpipes-init/generators/project/public/images/icons/tennpipes-icons.css +598 -0
  75. data/lib/tennpipes-init/generators/project/public/images/image1.jpg +0 -0
  76. data/lib/tennpipes-init/generators/project/public/images/image11.jpg +0 -0
  77. data/lib/tennpipes-init/generators/project/public/images/image2.jpg +0 -0
  78. data/lib/tennpipes-init/generators/project/public/images/image3.jpg +0 -0
  79. data/lib/tennpipes-init/generators/project/public/images/intuit.png +0 -0
  80. data/lib/tennpipes-init/generators/project/public/images/krispykreme.png +0 -0
  81. data/lib/tennpipes-init/generators/project/public/images/placeholders/README.md +302 -0
  82. data/lib/tennpipes-init/generators/project/public/images/placeholders/bower.json +4 -0
  83. data/lib/tennpipes-init/generators/project/public/images/placeholders/composer.json +34 -0
  84. data/lib/tennpipes-init/generators/project/public/images/placeholders/gulpfile.js +92 -0
  85. data/lib/tennpipes-init/generators/project/public/images/placeholders/holder.js +1920 -0
  86. data/lib/tennpipes-init/generators/project/public/images/placeholders/holder.min.js +12 -0
  87. data/lib/tennpipes-init/generators/project/public/images/placeholders/package.json +46 -0
  88. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/holder.js +1411 -0
  89. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/lib/augment.js +27 -0
  90. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/lib/ondomready.js +155 -0
  91. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/lib/polyfills.js +177 -0
  92. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/scenegraph.js +101 -0
  93. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/utils.js +129 -0
  94. data/lib/tennpipes-init/generators/project/public/images/priceline.com.png +0 -0
  95. data/lib/tennpipes-init/generators/project/public/images/stripe.png +0 -0
  96. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes.min.js +6081 -0
  97. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.abide.js +340 -0
  98. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.accordion.js +67 -0
  99. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.alert.js +43 -0
  100. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.clearing.js +556 -0
  101. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.dropdown.js +448 -0
  102. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.equalizer.js +77 -0
  103. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.interchange.js +354 -0
  104. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.joyride.js +932 -0
  105. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.js +703 -0
  106. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.magellan.js +203 -0
  107. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.offcanvas.js +152 -0
  108. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.orbit.js +476 -0
  109. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.reveal.js +471 -0
  110. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.slider.js +263 -0
  111. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.tab.js +237 -0
  112. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.tooltip.js +307 -0
  113. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.topbar.js +452 -0
  114. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/fastclick.js +8 -0
  115. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/jquery.cookie.js +8 -0
  116. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/jquery.js +26 -0
  117. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/modernizr.js +8 -0
  118. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/placeholder.js +2 -0
  119. data/lib/tennpipes-init/generators/project/public/stylesheets/app.css~ +178 -0
  120. data/lib/tennpipes-init/generators/project/public/stylesheets/app1.css~ +177 -0
  121. data/lib/tennpipes-init/generators/project/public/stylesheets/ennkeypee.css +214 -0
  122. data/lib/tennpipes-init/generators/project/public/stylesheets/ennkeypee.css~ +214 -0
  123. data/lib/tennpipes-init/generators/project/public/stylesheets/normalize.css +427 -0
  124. data/lib/tennpipes-init/generators/project/public/stylesheets/tennpipes.css +6201 -0
  125. data/lib/tennpipes-init/generators/project/public/stylesheets/tennpipes.css~ +6201 -0
  126. data/lib/tennpipes-init/generators/project/public/stylesheets/tennpipes.min.css +1 -0
  127. data/lib/tennpipes-init/generators/runner.rb +139 -0
  128. data/lib/tennpipes-init/generators/task.rb +45 -0
  129. data/lib/tennpipes-init/generators/templates/Gemfile.tt +32 -0
  130. data/lib/tennpipes-init/generators/templates/Rakefile.tt +8 -0
  131. data/lib/tennpipes-init/generators/templates/controller.rb.tt +22 -0
  132. data/lib/tennpipes-init/generators/templates/gem/README.md.tt +29 -0
  133. data/lib/tennpipes-init/generators/templates/gem/gemspec.tt +19 -0
  134. data/lib/tennpipes-init/generators/templates/gem/lib/libname.tt +6 -0
  135. data/lib/tennpipes-init/generators/templates/gem/lib/libname/version.tt +3 -0
  136. data/lib/tennpipes-init/generators/templates/helper.rb.tt +13 -0
  137. data/lib/tennpipes-init/generators/templates/initializer.rb.tt +5 -0
  138. data/lib/tennpipes-init/generators/templates/mailer.rb.tt +54 -0
  139. data/lib/tennpipes-init/generators/templates/project_bin.tt +14 -0
  140. data/lib/tennpipes-init/generators/templates/task.rb.tt +7 -0
  141. data/lib/tennpipes-init/tennpipes-tasks/activerecord.rb +377 -0
  142. data/lib/tennpipes-init/tennpipes-tasks/database.rb +12 -0
  143. data/lib/tennpipes-init/tennpipes-tasks/datamapper.rb +94 -0
  144. data/lib/tennpipes-init/tennpipes-tasks/minirecord.rb +19 -0
  145. data/lib/tennpipes-init/tennpipes-tasks/mongoid.rb +215 -0
  146. data/lib/tennpipes-init/tennpipes-tasks/mongomapper.rb +55 -0
  147. data/lib/tennpipes-init/tennpipes-tasks/sequel.rb +85 -0
  148. data/lib/tennpipes-init/tennpipes-tasks/sql-helpers.rb +72 -0
  149. data/test/fixtures/admin_template.rb +7 -0
  150. data/test/fixtures/example_template.rb +15 -0
  151. data/test/fixtures/git_template.rb +4 -0
  152. data/test/fixtures/plugin_template.rb +13 -0
  153. data/test/fixtures/rake_template.rb +9 -0
  154. data/test/helper.rb +103 -0
  155. data/test/test_app_generator.rb +142 -0
  156. data/test/test_cli.rb +27 -0
  157. data/test/test_component_generator.rb +98 -0
  158. data/test/test_controller_generator.rb +272 -0
  159. data/test/test_generator.rb +13 -0
  160. data/test/test_helper_generator.rb +133 -0
  161. data/test/test_mailer_generator.rb +69 -0
  162. data/test/test_migration_generator.rb +222 -0
  163. data/test/test_model_generator.rb +553 -0
  164. data/test/test_plugin_generator.rb +152 -0
  165. data/test/test_project_generator.rb +757 -0
  166. data/test/test_task_generator.rb +53 -0
  167. metadata +285 -0
@@ -0,0 +1,67 @@
1
+ require 'tennpipes-base/cli/base' unless defined?(Tennpipes::Cli::Base)
2
+ require 'net/https'
3
+
4
+ module Tennpipes
5
+ module Generators
6
+ ##
7
+ # Responsible for executing plugins instructions within a Tennpipes project.
8
+ #
9
+ class Plugin < Thor::Group
10
+ # Defines the default URL for official tennpipes recipe plugins.
11
+ PLUGIN_URL = 'https://github.com/tennpipes/tennpipes-recipes/tree/master/plugins'
12
+ Tennpipes::Generators.add_generator(:plugin, self)
13
+
14
+ def self.source_root; File.expand_path(File.dirname(__FILE__)); end
15
+ def self.banner; "tennpipes-init plugin [plugin_identifier] [options]"; end
16
+
17
+ include Thor::Actions
18
+ include Tennpipes::Generators::Actions
19
+ include Tennpipes::Generators::Runner
20
+
21
+ desc "Description:\n\n\ttennpipes-init plugin sets up a plugin within a Tennpipes application"
22
+
23
+ argument :plugin_file, :desc => "The name or path to the Tennpipes plugin", :optional => true
24
+
25
+ class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string
26
+ class_option :list, :desc => "list available plugins", :aliases => '-l', :default => false, :type => :boolean
27
+ class_option :destroy, :aliases => '-d', :default => false, :type => :boolean
28
+
29
+ # Show help if no ARGV given.
30
+ require_arguments!
31
+
32
+ ##
33
+ # Create the Tennpipes Plugin.
34
+ #
35
+ def setup_plugin
36
+ if options[:list] || plugin_file.nil?
37
+ list_plugins
38
+ else # executing the plugin instructions
39
+ self.destination_root = options[:root]
40
+ if in_app_root?
41
+ self.behavior = :revoke if options[:destroy]
42
+ execute_runner(:plugin, plugin_file)
43
+ else
44
+ say "You are not at the root of a Tennpipes application! (config/boot.rb not found)"
45
+ end
46
+ end
47
+ end
48
+
49
+ no_tasks do
50
+ def list_plugins
51
+ plugins = {}
52
+ uri = URI.parse(PLUGIN_URL)
53
+ http = Net::HTTP.new(uri.host, uri.port)
54
+ http.use_ssl = true if uri.scheme == "https"
55
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
56
+ http.start do
57
+ http.request_get(uri.path) do |res|
58
+ plugins = res.body.scan(%r{/plugins/(\w+)_plugin.rb}).uniq
59
+ end
60
+ end
61
+ say "Available plugins:", :green
62
+ say plugins.map { |plugin| " - #{plugin}" }.join("\n")
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,160 @@
1
+ require 'tennpipes-base/version'
2
+ require 'securerandom' unless defined?(SecureRandom)
3
+
4
+ module Tennpipes
5
+ module Generators
6
+ ##
7
+ # Responsible for generating new Tennpipes projects based on the specified project components.
8
+ #
9
+ class Project < Thor::Group
10
+ Tennpipes::Generators.add_generator(:project, self)
11
+
12
+ def self.source_root; File.expand_path(File.dirname(__FILE__)); end
13
+ def self.banner; "tennpipes-init project [name] [options]"; end
14
+
15
+ include Thor::Actions
16
+ include Tennpipes::Generators::Actions
17
+ include Tennpipes::Generators::Runner
18
+ include Tennpipes::Generators::Components::Actions
19
+
20
+ desc "Description:\n\n\ttennpipes-init project generates a new Tennpipes project"
21
+
22
+ argument :name, :desc => 'The name of your tennpipes project'
23
+
24
+ class_option :app , :desc => 'The application name', :aliases => '-n', :default => nil, :type => :string
25
+ class_option :bundle, :desc => 'Run bundle install', :aliases => '-b', :default => false, :type => :boolean
26
+ class_option :root, :desc => 'The root destination', :aliases => '-r', :default => '.', :type => :string
27
+ class_option :dev, :desc => 'Use tennpipes from a git checkout', :default => false, :type => :boolean
28
+ class_option :tiny, :desc => 'Generate tiny app skeleton', :aliases => '-i', :default => false, :type => :boolean
29
+ class_option :lean, :desc => 'Generate lean project without apps', :aliases => '-l', :default => false, :type => :boolean
30
+ class_option :adapter, :desc => 'SQL adapter for ORM (sqlite, mysql, mysql2, mysql-gem, postgres)', :aliases => '-a', :default => 'sqlite', :type => :string
31
+ class_option :template, :desc => 'Generate project from template', :aliases => '-p', :default => nil, :type => :string
32
+ class_option :gem, :desc => 'Generate project as a gem', :aliases => '-g', :default => false, :type => :boolean
33
+ class_option :migration_format, :desc => 'Filename format for migrations (number, timestamp)', :default => 'number', :type => :string
34
+
35
+ # Definitions for the available customizable components.
36
+ defines_component_options
37
+
38
+ # Show help if no ARGV given.
39
+ require_arguments!
40
+
41
+ ##
42
+ # Copies over the Tennpipes base application app.
43
+ #
44
+ def setup_project
45
+ valid_constant? name
46
+ app = (options[:app] || "App")
47
+
48
+ @project_name = name.gsub(/\W/, '_').underscore.camelize
49
+ @app_name = app.gsub(/\W/, '_').camelize
50
+ self.destination_root = File.join(options[:root], name)
51
+ if options[:template]
52
+ execute_runner(:template, options[:template])
53
+ else
54
+ directory('project/', destination_root)
55
+ empty_directory destination_root('public/images')
56
+ empty_directory destination_root('public/javascripts')
57
+ empty_directory destination_root('public/stylesheets')
58
+ store_component_config('.components')
59
+ unless options[:lean]
60
+ app_skeleton('app', options[:tiny])
61
+ append_file destination_root('config/apps.rb'), "Tennpipes.mount('#{@project_name}::#{@app_name}', :app_file => Tennpipes.root('app/app.rb')).to('/')\n"
62
+ end
63
+ template 'templates/Gemfile.tt', destination_root('Gemfile')
64
+ template 'templates/Rakefile.tt', destination_root('Rakefile')
65
+ template 'templates/project_bin.tt', destination_root("bin/#{name}")
66
+ File.chmod(0755, destination_root("bin/#{name}"))
67
+ if options.gem?
68
+ template 'templates/gem/gemspec.tt', destination_root(name + '.gemspec')
69
+ template 'templates/gem/README.md.tt', destination_root('README.md')
70
+ template 'templates/gem/lib/libname.tt', destination_root("lib/#{name}.rb")
71
+ template 'templates/gem/lib/libname/version.tt', destination_root("lib/#{name}/version.rb")
72
+ else
73
+ empty_directory_with_keep_file destination_root('tmp')
74
+ empty_directory_with_keep_file destination_root('log')
75
+ end
76
+ end
77
+ end
78
+
79
+ ##
80
+ # For each component, retrieve a valid choice and then execute the associated generator.
81
+ #
82
+ def setup_components
83
+ return if options[:template]
84
+ @_components = options.dup.slice(*self.class.component_types)
85
+ self.class.component_types.each do |comp|
86
+ choice = @_components[comp] = resolve_valid_choice(comp)
87
+ execute_component_setup(comp, choice)
88
+ end
89
+ store_component_config('.components')
90
+ store_component_choice(:namespace, @project_name)
91
+ store_component_choice(:migration_format, options[:migration_format])
92
+ end
93
+
94
+ ##
95
+ # Generates test files for tiny app skeleton.
96
+ #
97
+ def setup_test_files
98
+ if options[:tiny] && @_components[:test] != :none
99
+ test_component = @_components[:test]
100
+ test_component = "rspec" if test_component == "cucumber"
101
+ uppercase_test_component = test_component.upcase
102
+ controller_template_name = "#{uppercase_test_component}_CONTROLLER_TEST"
103
+ helper_template_name = "#{uppercase_test_component}_HELPER_TEST"
104
+ return unless defined?(controller_template_name)
105
+
106
+ controller_content = instance_eval(controller_template_name).gsub(/!PATH!/, "Controller").gsub(/!NAME!/, "").gsub(/!EXPANDED_PATH!/, "/")
107
+ helper_content = instance_eval(helper_template_name).gsub(/!NAME!/, "#{@project_name}::#{@app_name}::#{DEFAULT_HELPER_NAME}")
108
+
109
+ proc{|*args| args.map{|str| str.gsub!(/!PATH!/, recognize_path)} }.call(controller_content, helper_content)
110
+
111
+ directory_name = [:rspec, :steak].include?(test_component.to_sym) ? "spec" : "test"
112
+ base_path = File.join(directory_name, "app")
113
+ create_file destination_root("#{base_path}/controllers/controllers_#{directory_name}.rb"), controller_content, :skip => true
114
+ create_file destination_root("#{base_path}/helpers/helpers_#{directory_name}.rb"), helper_content, :skip => true
115
+ helper_path = destination_root(File.join(directory_name, "#{directory_name == "spec" ? "spec_helper" : "test_config"}.rb"))
116
+ gsub_file helper_path, %r{helpers/\*\*/\*\.rb}, "helpers.rb"
117
+ end
118
+ end
119
+
120
+ ##
121
+ # Bundle all required components using bundler and Gemfile.
122
+ #
123
+ def bundle_dependencies
124
+ if options[:bundle]
125
+ run_bundler
126
+ end
127
+ end
128
+
129
+ ##
130
+ # Finish message.
131
+ #
132
+ def finish_message
133
+ say
134
+ say '=' * 65, :green
135
+ say "#{name} is ready for development!", :green
136
+ say '=' * 65, :green
137
+ say "$ cd #{options[:root]}/#{name}"
138
+ say "$ bundle" unless options[:bundle]
139
+ say "=" * 65, :green
140
+ say
141
+ end
142
+
143
+ ##
144
+ # Returns the git author name config or a fill-in value.
145
+ #
146
+ def git_author_name
147
+ git_author_name = `git config user.name`.chomp rescue ''
148
+ git_author_name.empty? ? "TODO: Write your name" : git_author_name
149
+ end
150
+
151
+ ##
152
+ # Returns the git author email config or a fill-in value.
153
+ #
154
+ def git_author_email
155
+ git_author_email = `git config user.email`.chomp rescue ''
156
+ git_author_email.empty? ? "TODO: Write your email address" : git_author_email
157
+ end
158
+ end
159
+ end
160
+ end
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env rackup
2
+ # encoding: utf-8
3
+
4
+ # This file can be used to start Tennpipes,
5
+ # just execute it from the command line.
6
+
7
+ require File.expand_path("../config/boot.rb", __FILE__)
8
+
9
+ run Tennpipes.application
@@ -0,0 +1,35 @@
1
+ ##
2
+ # This file mounts each app in the Tennpipes project to a specified sub-uri.
3
+ # You can mount additional applications using any of these commands below:
4
+ #
5
+ # Tennpipes.mount('blog').to('/blog')
6
+ # Tennpipes.mount('blog', :app_class => 'BlogApp').to('/blog')
7
+ # Tennpipes.mount('blog', :app_file => 'path/to/blog/app.rb').to('/blog')
8
+ #
9
+ # You can also map apps to a specified host:
10
+ #
11
+ # Tennpipes.mount('Admin').host('admin.example.org')
12
+ # Tennpipes.mount('WebSite').host(/.*\.?example.org/)
13
+ # Tennpipes.mount('Foo').to('/foo').host('bar.example.org')
14
+ #
15
+ # Note 1: Mounted apps (by default) should be placed into the project root at '/app_name'.
16
+ # Note 2: If you use the host matching remember to respect the order of the rules.
17
+ #
18
+ # By default, this file mounts the primary app which was generated with this project.
19
+ # However, the mounted app can be modified as needed:
20
+ #
21
+ # Tennpipes.mount('AppName', :app_file => 'path/to/file', :app_class => 'BlogApp').to('/')
22
+ #
23
+
24
+ ##
25
+ # Setup global project settings for your apps. These settings are inherited by every subapp. You can
26
+ # override these settings in the subapps as needed.
27
+ #
28
+ Tennpipes.configure_apps do
29
+ # enable :sessions
30
+ set :session_secret, '<%= SecureRandom.hex(32) %>'
31
+ set :protection, :except => :path_traversal
32
+ set :protect_from_csrf, true
33
+ end
34
+
35
+ # Mounts the core application for this project
@@ -0,0 +1,49 @@
1
+ # Defines our constants
2
+ RACK_ENV = ENV['RACK_ENV'] ||= 'development' unless defined?(RACK_ENV)
3
+ TENNPIPES_ROOT = File.expand_path('../..', __FILE__) unless defined?(TENNPIPES_ROOT)
4
+
5
+ # Load our dependencies
6
+ require 'bundler/setup'
7
+ Bundler.require(:default, RACK_ENV)
8
+
9
+ ##
10
+ # ## Enable devel logging
11
+ #
12
+ # Tennpipes::Logger::Config[:development][:log_level] = :devel
13
+ # Tennpipes::Logger::Config[:development][:log_static] = true
14
+ #
15
+ # ## Enable logging of source location
16
+ #
17
+ # Tennpipes::Logger::Config[:development][:source_location] = true
18
+ #
19
+ # ## Configure your I18n
20
+ #
21
+ # I18n.default_locale = :en
22
+ # I18n.enforce_available_locales = false
23
+ #
24
+ # ## Configure your HTML5 data helpers
25
+ #
26
+ # Tennpipes::Helpers::TagHelpers::DATA_ATTRIBUTES.push(:dialog)
27
+ # text_field :foo, :dialog => true
28
+ # Generates: <input type="text" data-dialog="true" name="foo" />
29
+ #
30
+ # ## Add helpers to mailer
31
+ #
32
+ # Mail::Message.class_eval do
33
+ # include Tennpipes::Helpers::NumberHelpers
34
+ # include Tennpipes::Helpers::TranslationHelpers
35
+ # end
36
+
37
+ ##
38
+ # Add your before (RE)load hooks here
39
+ #
40
+ Tennpipes.before_load do
41
+ end
42
+
43
+ ##
44
+ # Add your after (RE)load hooks here
45
+ #
46
+ Tennpipes.after_load do
47
+ end
48
+
49
+ Tennpipes.load!
@@ -0,0 +1,68 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+ xmlns:cc="http://creativecommons.org/ns#"
7
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+ xmlns:svg="http://www.w3.org/2000/svg"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ xmlns:xlink="http://www.w3.org/1999/xlink"
11
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13
+ id="svg2"
14
+ version="1.1"
15
+ inkscape:version="0.48.5 r10040"
16
+ width="30"
17
+ height="30"
18
+ sodipodi:docname="ennkeypee_bluelogo.png"
19
+ inkscape:export-filename="ennkeypee.svg.png"
20
+ inkscape:export-xdpi="90"
21
+ inkscape:export-ydpi="90">
22
+ <metadata
23
+ id="metadata8">
24
+ <rdf:RDF>
25
+ <cc:Work
26
+ rdf:about="">
27
+ <dc:format>image/svg+xml</dc:format>
28
+ <dc:type
29
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
30
+ <dc:title></dc:title>
31
+ </cc:Work>
32
+ </rdf:RDF>
33
+ </metadata>
34
+ <defs
35
+ id="defs6" />
36
+ <sodipodi:namedview
37
+ pagecolor="#ffffff"
38
+ bordercolor="#666666"
39
+ borderopacity="1"
40
+ objecttolerance="10"
41
+ gridtolerance="10"
42
+ guidetolerance="10"
43
+ inkscape:pageopacity="0"
44
+ inkscape:pageshadow="2"
45
+ inkscape:window-width="640"
46
+ inkscape:window-height="480"
47
+ id="namedview4"
48
+ showgrid="false"
49
+ inkscape:zoom="9.6182292"
50
+ inkscape:cx="15"
51
+ inkscape:cy="15"
52
+ inkscape:window-x="65"
53
+ inkscape:window-y="24"
54
+ inkscape:window-maximized="0"
55
+ inkscape:current-layer="svg2" />
56
+ <image
57
+ width="30"
58
+ height="30"
59
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABHNCSVQICAgIfAhkiAAAAK9JREFU
60
+ SInt1jEKwlAMgOE/rwUXJ+so6CkEb+DmAQQXi3gaD+DgRdyER3F0cHR38Aia56oUOjxKWzQZE8gX
61
+ AoEIeaG0ECkAgjQNu6bB1uG0lNGwxKWXWpUQBoiequFEbuyn11rh1Tmj953q0Ko/I/cLCNuozpoc
62
+ Ocx2cbDIBNw8ChbuVeX/OyeDDTbYYIMN7h5cfgSeMmLjHwC8GEaPJqHP2o8BUM1KZfJC7aH/afgN
63
+ tZsfXt3Sf4QAAAAASUVORK5CYII=
64
+ "
65
+ id="image10"
66
+ x="0"
67
+ y="0" />
68
+ </svg>
@@ -0,0 +1,65 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+ xmlns:cc="http://creativecommons.org/ns#"
7
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+ xmlns:svg="http://www.w3.org/2000/svg"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ xmlns:xlink="http://www.w3.org/1999/xlink"
11
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13
+ id="svg2"
14
+ version="1.1"
15
+ inkscape:version="0.48.5 r10040"
16
+ width="30"
17
+ height="30"
18
+ sodipodi:docname="ennkeypee_whitelogo.png">
19
+ <metadata
20
+ id="metadata8">
21
+ <rdf:RDF>
22
+ <cc:Work
23
+ rdf:about="">
24
+ <dc:format>image/svg+xml</dc:format>
25
+ <dc:type
26
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
27
+ <dc:title></dc:title>
28
+ </cc:Work>
29
+ </rdf:RDF>
30
+ </metadata>
31
+ <defs
32
+ id="defs6" />
33
+ <sodipodi:namedview
34
+ pagecolor="#ffffff"
35
+ bordercolor="#666666"
36
+ borderopacity="1"
37
+ objecttolerance="10"
38
+ gridtolerance="10"
39
+ guidetolerance="10"
40
+ inkscape:pageopacity="0"
41
+ inkscape:pageshadow="2"
42
+ inkscape:window-width="640"
43
+ inkscape:window-height="480"
44
+ id="namedview4"
45
+ showgrid="false"
46
+ inkscape:zoom="9.6182292"
47
+ inkscape:cx="15"
48
+ inkscape:cy="15"
49
+ inkscape:window-x="65"
50
+ inkscape:window-y="24"
51
+ inkscape:window-maximized="0"
52
+ inkscape:current-layer="svg2" />
53
+ <image
54
+ width="30"
55
+ height="30"
56
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABHNCSVQICAgIfAhkiAAAAJ9JREFU
57
+ SInt1zEKwkAQBdD/h5Sp1FKIx0mXA3gBT5ML2XkDC0v7FJ5hfprFwgSFJSTBzDS7OwvzYGBhlpIc
58
+ C0SRVs4N29zg4nAxkjsDuE/s7ADcfsFPko8pVUn7z9yqWv0OSY27X3IKm9mVZJsFAziZWZ0DA+i+
59
+ XW7vOQUccMABBxzw+uCxQeAo6ZX2h9zC7l5KqtJxMHMx/SRioP9fuAc5siKo9t7jewAAAABJRU5E
60
+ rkJggg==
61
+ "
62
+ id="image10"
63
+ x="0"
64
+ y="0" />
65
+ </svg>