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,75 @@
1
+ RIPPLE_DB = (<<-RIAK) unless defined?(RIPPLE_DB)
2
+ development:
3
+ http_port: 8098
4
+ pb_port: 8087
5
+ host: localhost
6
+
7
+ # The test environment has additional keys for configuring the
8
+ # Riak::TestServer for your test/spec suite:
9
+ #
10
+ # * bin_dir specifies the path to the "riak" script that you use to
11
+ # start Riak (just the directory)
12
+ # * js_source_dir specifies where your custom Javascript functions for
13
+ # MapReduce should be loaded from. Usually app/mapreduce.
14
+ test:
15
+ http_port: 9000
16
+ pb_port: 9002
17
+ host: localhost
18
+ bin_dir: /usr/local/bin # Default for Homebrew.
19
+ js_source_dir: <%%= Tennpipes.root + "app/mapreduce" %>
20
+
21
+ production:
22
+ http_port: 8098
23
+ pb_port: 8087
24
+ host: localhost
25
+ RIAK
26
+ RIPPLE_CFG = (<<RIAK) unless defined?(RIPPLE_CFG)
27
+ # encoding: utf-8
28
+
29
+ require 'ripple'
30
+
31
+ if File.exist?(Tennpipes.root + "config/riak.yml")
32
+ Ripple.load_configuration Tennpipes.root.join('config', 'riak.yml'), [Tennpipes.env]
33
+ end
34
+ RIAK
35
+
36
+ def setup_orm
37
+ require_dependencies 'ripple'
38
+ create_file("config/riak.yml", RIPPLE_DB.gsub(/!NAME!/, @project_name.underscore))
39
+ create_file("config/database.rb", RIPPLE_CFG)
40
+ end
41
+
42
+ RIPPLE_MODEL = (<<-MODEL) unless defined?(RIPPLE_MODEL)
43
+ # encoding: utf-8
44
+
45
+ class !NAME!
46
+ include Ripple::Document
47
+
48
+ # Standart properties
49
+ # property :name, String
50
+ !FIELDS!
51
+
52
+ # Relations
53
+ # many :addresses
54
+ # many :friends, :class_name => "Person"
55
+ # one :account
56
+ end
57
+
58
+ MODEL
59
+ # options => { :fields => ["title:string", "body:string"], :app => 'app' }
60
+ def create_model_file(name, options={})
61
+ model_path = destination_root(options[:app], 'models', "#{name.to_s.underscore}.rb")
62
+ field_tuples = options[:fields].map { |value| value.split(":") }
63
+ column_declarations = field_tuples.map { |field, kind| "property :#{field}, #{kind.underscore.camelize}" }.join("\n ")
64
+ model_contents = RIPPLE_MODEL.gsub(/!NAME!/, name.to_s.underscore.camelize)
65
+ model_contents.gsub!(/!FIELDS!/, column_declarations)
66
+ create_file(model_path, model_contents)
67
+ end
68
+
69
+ def create_model_migration(filename, name, fields)
70
+ # NO MIGRATION NEEDED
71
+ end
72
+
73
+ def create_migration_file(migration_name, name, columns)
74
+ # NO MIGRATION NEEDED
75
+ end
@@ -0,0 +1,99 @@
1
+ SEQUEL = (<<-SEQUEL) unless defined?(SEQUEL)
2
+ Sequel::Model.plugin(:schema)
3
+ Sequel::Model.raise_on_save_failure = false # Do not throw exceptions on failure
4
+ Sequel::Model.db = case Tennpipes.env
5
+ when :development then Sequel.connect(!DB_DEVELOPMENT!, :loggers => [logger])
6
+ when :production then Sequel.connect(!DB_PRODUCTION!, :loggers => [logger])
7
+ when :test then Sequel.connect(!DB_TEST!, :loggers => [logger])
8
+ end
9
+ SEQUEL
10
+
11
+ def setup_orm
12
+ sequel = SEQUEL
13
+ db = @project_name.underscore
14
+ require_dependencies 'sequel'
15
+ case options[:adapter]
16
+ when 'mysql-gem'
17
+ sequel.gsub!(/!DB_DEVELOPMENT!/, "\"mysql://localhost/#{db}_development\"")
18
+ sequel.gsub!(/!DB_PRODUCTION!/, "\"mysql://localhost/#{db}_production\"")
19
+ sequel.gsub!(/!DB_TEST!/,"\"mysql://localhost/#{db}_test\"")
20
+ require_dependencies 'mysql', :version => "~> 2.8.1"
21
+ 'mysql'
22
+ when 'mysql', 'mysql2'
23
+ sequel.gsub!(/!DB_DEVELOPMENT!/, "\"mysql2://localhost/#{db}_development\"")
24
+ sequel.gsub!(/!DB_PRODUCTION!/, "\"mysql2://localhost/#{db}_production\"")
25
+ sequel.gsub!(/!DB_TEST!/,"\"mysql2://localhost/#{db}_test\"")
26
+ require_dependencies 'mysql2'
27
+ 'mysql2'
28
+ when 'postgres'
29
+ sequel.gsub!(/!DB_DEVELOPMENT!/, "\"postgres://localhost/#{db}_development\"")
30
+ sequel.gsub!(/!DB_PRODUCTION!/, "\"postgres://localhost/#{db}_production\"")
31
+ sequel.gsub!(/!DB_TEST!/,"\"postgres://localhost/#{db}_test\"")
32
+ require_dependencies 'pg'
33
+ 'pg'
34
+ else
35
+ sequel.gsub!(/!DB_DEVELOPMENT!/,"\"sqlite://db/#{db}_development.db\"")
36
+ sequel.gsub!(/!DB_PRODUCTION!/, "\"sqlite://db/#{db}_production.db\"")
37
+ sequel.gsub!(/!DB_TEST!/, "\"sqlite://db/#{db}_test.db\"")
38
+ require_dependencies 'sqlite3'
39
+ 'sqlite3'
40
+ end
41
+ create_file("config/database.rb", sequel)
42
+ empty_directory('db/migrate')
43
+ end
44
+
45
+ SQ_MODEL = (<<-MODEL) unless defined?(SQ_MODEL)
46
+ class !NAME! < Sequel::Model
47
+
48
+ end
49
+ MODEL
50
+
51
+ # options => { :fields => ["title:string", "body:string"], :app => 'app' }
52
+ def create_model_file(name, options={})
53
+ model_path = destination_root(options[:app], 'models', "#{name.to_s.underscore}.rb")
54
+ model_contents = SQ_MODEL.gsub(/!NAME!/, name.to_s.underscore.camelize)
55
+ create_file(model_path, model_contents)
56
+ end
57
+
58
+ SQ_MIGRATION = (<<-MIGRATION) unless defined?(SQ_MIGRATION)
59
+ Sequel.migration do
60
+ up do
61
+ !UP!
62
+ end
63
+
64
+ down do
65
+ !DOWN!
66
+ end
67
+ end
68
+ MIGRATION
69
+
70
+ SQ_MODEL_UP_MG = (<<-MIGRATION).gsub(/^/, ' ') unless defined?(SQ_MODEL_UP_MG)
71
+ create_table :!TABLE! do
72
+ primary_key :id
73
+ !FIELDS!
74
+ end
75
+ MIGRATION
76
+
77
+ SQ_MODEL_DOWN_MG = (<<-MIGRATION) unless defined?(SQ_MODEL_DOWN_MG)
78
+ drop_table :!TABLE!
79
+ MIGRATION
80
+
81
+ def create_model_migration(migration_name, name, columns)
82
+ output_model_migration(migration_name, name, columns,
83
+ :column_format => Proc.new { |field, kind| "#{kind.underscore.camelize} :#{field}" },
84
+ :base => SQ_MIGRATION, :up => SQ_MODEL_UP_MG, :down => SQ_MODEL_DOWN_MG)
85
+ end
86
+
87
+ SQ_CHANGE_MG = (<<-MIGRATION).gsub(/^/, ' ') unless defined?(SQ_CHANGE_MG)
88
+ alter_table :!TABLE! do
89
+ !COLUMNS!
90
+ end
91
+ MIGRATION
92
+
93
+ def create_migration_file(migration_name, name, columns)
94
+ output_migration_file(migration_name, name, columns,
95
+ :base => SQ_MIGRATION, :change_format => SQ_CHANGE_MG,
96
+ :add => Proc.new { |field, kind| "add_column :#{field}, #{kind.underscore.camelize}" },
97
+ :remove => Proc.new { |field, kind| "drop_column :#{field}" }
98
+ )
99
+ end
@@ -0,0 +1,3 @@
1
+ def setup_renderer
2
+ require_dependencies 'erubis', :version => "~> 2.7.0"
3
+ end
@@ -0,0 +1,3 @@
1
+ def setup_renderer
2
+ require_dependencies 'haml'
3
+ end
@@ -0,0 +1,4 @@
1
+ def setup_renderer
2
+ require_dependencies 'liquid', :version => "= 2.1.2"
3
+ require_dependencies 'liquify'
4
+ end
@@ -0,0 +1,3 @@
1
+ def setup_renderer
2
+ require_dependencies 'slim'
3
+ end
@@ -0,0 +1,10 @@
1
+ def setup_script
2
+ begin
3
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/js/dojo.js', destination_root("/public/javascripts/dojo.js"))
4
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/ujs/dojo.js', destination_root("/public/javascripts/dojo-ujs.js"))
5
+ rescue
6
+ copy_file('templates/static/js/dojo.js', destination_root("/public/javascripts/dojo.js"))
7
+ copy_file('templates/static/ujs/dojo.js', destination_root("/public/javascripts/dojo-ujs.js"))
8
+ end
9
+ create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
10
+ end
@@ -0,0 +1,10 @@
1
+ def setup_script
2
+ begin
3
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/js/ext.js', destination_root("/public/javascripts/ext.js"))
4
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/ujs/ext.js', destination_root("/public/javascripts/ext-ujs.js"))
5
+ rescue
6
+ copy_file('templates/static/js/ext.js', destination_root("/public/javascripts/ext.js"))
7
+ copy_file('templates/static/ujs/ext.js', destination_root("/public/javascripts/ext-ujs.js"))
8
+ end
9
+ create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
10
+ end
@@ -0,0 +1,10 @@
1
+ def setup_script
2
+ begin
3
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/js/jquery.js', destination_root("/public/javascripts/jquery.js"))
4
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/ujs/jquery.js', destination_root("/public/javascripts/jquery-ujs.js"))
5
+ rescue
6
+ copy_file('templates/static/js/jquery.js', destination_root("/public/javascripts/jquery.js"))
7
+ copy_file('templates/static/ujs/jquery.js', destination_root("/public/javascripts/jquery-ujs.js"))
8
+ end
9
+ create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
10
+ end
@@ -0,0 +1,10 @@
1
+ def setup_script
2
+ begin
3
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/js/mootools.js', destination_root("/public/javascripts/mootools.js"))
4
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/ujs/mootools.js', destination_root("/public/javascripts/mootools-ujs.js"))
5
+ rescue
6
+ copy_file('templates/static/js/mootools.js', destination_root("/public/javascripts/mootools.js"))
7
+ copy_file('templates/static/ujs/mootools.js', destination_root("/public/javascripts/mootools-ujs.js"))
8
+ end
9
+ create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
10
+ end
@@ -0,0 +1,12 @@
1
+ def setup_script
2
+ begin
3
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/js/protopak.js', destination_root("/public/javascripts/protopak.js"))
4
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/js/lowpro.js', destination_root("/public/javascripts/lowpro.js"))
5
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/ujs/prototype.js', destination_root("/public/javascripts/prototype-ujs.js"))
6
+ rescue
7
+ copy_file('templates/static/js/protopak.js', destination_root("/public/javascripts/protopak.js"))
8
+ copy_file('templates/static/js/lowpro.js', destination_root("/public/javascripts/lowpro.js"))
9
+ copy_file('templates/static/ujs/prototype.js', destination_root("/public/javascripts/prototype-ujs.js"))
10
+ end
11
+ create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
12
+ end
@@ -0,0 +1,10 @@
1
+ def setup_script
2
+ begin
3
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/js/right.js', destination_root("/public/javascripts/right.js"))
4
+ get('https://raw.github.com/tennpipes/tennpipes-static/master/ujs/right.js', destination_root("/public/javascripts/right-ujs.js"))
5
+ rescue
6
+ copy_file('templates/static/js/right.js', destination_root("/public/javascripts/right.js"))
7
+ copy_file('templates/static/ujs/right.js', destination_root("/public/javascripts/right-ujs.js"))
8
+ end
9
+ create_file(destination_root('/public/javascripts/application.js'), "// Put your application scripts here")
10
+ end
@@ -0,0 +1,39 @@
1
+ COMPASS_INIT = <<-COMPASS unless defined?(COMPASS_INIT)
2
+ # Enables support for Compass, a stylesheet authoring framework based on SASS.
3
+ # See http://compass-style.org/ for more details.
4
+ # Store Compass/SASS files (by default) within 'app/stylesheets'.
5
+
6
+ module CompassInitializer
7
+ def self.registered(app)
8
+ require 'sass/plugin/rack'
9
+
10
+ Compass.configuration do |config|
11
+ config.project_path = Tennpipes.root
12
+ config.sass_dir = "app/stylesheets"
13
+ config.project_type = :stand_alone
14
+ config.http_path = "/"
15
+ config.css_dir = "public/stylesheets"
16
+ config.images_dir = "public/images"
17
+ config.javascripts_dir = "public/javascripts"
18
+ config.output_style = :compressed
19
+ end
20
+
21
+ Compass.configure_sass_plugin!
22
+ Compass.handle_configuration_change!
23
+
24
+ app.use Sass::Plugin::Rack
25
+ end
26
+ end
27
+ COMPASS
28
+
29
+ COMPASS_REGISTER = <<-COMPASSR unless defined?(COMPASS_REGISTER)
30
+ register CompassInitializer\n
31
+ COMPASSR
32
+
33
+ def setup_stylesheet
34
+ require_dependencies 'compass'
35
+ create_file destination_root('/lib/compass_plugin.rb'), COMPASS_INIT
36
+ inject_into_file destination_root('/app/app.rb'), COMPASS_REGISTER, :after => "register Tennpipes::Helpers\n"
37
+
38
+ directory "components/stylesheets/compass/", destination_root('/app/stylesheets')
39
+ end
@@ -0,0 +1,43 @@
1
+ // This import applies a global reset to any page that imports this stylesheet.
2
+ @import "blueprint/reset";
3
+
4
+ // To configure blueprint, edit the partials/base.sass file.
5
+ @import "partials/base";
6
+
7
+ // Import all the default blueprint modules so that we can access their mixins.
8
+ @import "blueprint";
9
+
10
+ // Import the non-default scaffolding module.
11
+ @import "blueprint/scaffolding";
12
+
13
+ // To generate css equivalent to the blueprint css but with your
14
+ // configuration applied, uncomment:
15
+ // @include blueprint
16
+
17
+ // But Compass recommends that you scope your blueprint styles
18
+ // So that you can better control what pages use blueprint
19
+ // when stylesheets are concatenated together.
20
+ @include blueprint-scaffolding("body.bp");
21
+
22
+ body.bp {
23
+ @include blueprint-typography(true);
24
+ @include blueprint-utilities;
25
+ @include blueprint-debug;
26
+ @include blueprint-interaction;
27
+ // Remove the scaffolding when you're ready to start doing visual design.
28
+ // Or leave it in if you're happy with how blueprint looks out-of-the-box
29
+ }
30
+
31
+ form.bp {
32
+ @include blueprint-form;
33
+ }
34
+
35
+ .two-col {
36
+ @include container;
37
+ background-color: #cccccc;
38
+ #header, #footer {
39
+ @include column(24); }
40
+ #sidebar {
41
+ @include column(3); }
42
+ #content {
43
+ @include column(21, true); } }
@@ -0,0 +1,12 @@
1
+ // Here is where you can define your constants for your application and to
2
+ // configure the blueprint framework. Feel free to delete these if you want
3
+ // keep the defaults:
4
+
5
+ $blueprint-grid-columns: 24;
6
+ $blueprint-container-size: 950px;
7
+ $blueprint-grid-margin: 10px;
8
+
9
+ // Use this to calculate the width based on the total width.
10
+ // Or you can set !blueprint_grid_width to a fixed value and
11
+ // unset !blueprint_container_size -- it will be calculated for you.
12
+ $blueprint-grid-width: ($blueprint-container-size + $blueprint-grid-margin) / $blueprint-grid-columns - $blueprint-grid-margin;
@@ -0,0 +1,25 @@
1
+ LESS_INIT = <<-LESS unless defined?(LESS_INIT)
2
+ # Enables support for Less template reloading for rack.
3
+ # Store Less files by default within 'app/stylesheets/'.
4
+ # See http://github.com/kelredd/rack-less for more details.
5
+ require 'rack/less'
6
+ # optional - use as necessary
7
+ Rack::Less.configure do |config|
8
+ config.compress = true
9
+ # config.cache = true
10
+ # other configs ...
11
+ end
12
+ app.use Rack::Less,
13
+ :root => Tennpipes.root,
14
+ :source => 'app/stylesheets',
15
+ :public => 'public',
16
+ :hosted_at => 'stylesheets'
17
+ LESS
18
+
19
+ def setup_stylesheet
20
+ require_dependencies 'less'
21
+ require_dependencies 'rack-less'
22
+ require_dependencies 'therubyracer'
23
+ initializer :less, LESS_INIT
24
+ empty_directory destination_root('/app/stylesheets')
25
+ end
@@ -0,0 +1,15 @@
1
+ SASS_INIT = <<-SASS unless defined?(SASS_INIT)
2
+ # Enables support for SASS template reloading in rack applications.
3
+ # See http://nex-3.com/posts/88-sass-supports-rack for more details.
4
+ # Store SASS files (by default) within 'app/stylesheets'.
5
+ require 'sass/plugin/rack'
6
+ Sass::Plugin.options[:template_location] = Tennpipes.root("app/stylesheets")
7
+ Sass::Plugin.options[:css_location] = Tennpipes.root("public/stylesheets")
8
+ app.use Sass::Plugin::Rack
9
+ SASS
10
+
11
+ def setup_stylesheet
12
+ require_dependencies 'sass'
13
+ initializer :sass, SASS_INIT.chomp
14
+ empty_directory destination_root('/app/stylesheets')
15
+ end
@@ -0,0 +1,16 @@
1
+ SCSS_INIT = <<-SCSS unless defined?(SCSS_INIT)
2
+ # Enables support for SCSS template reloading in rack applications.
3
+ # See http://nex-3.com/posts/88-sass-supports-rack for more details.
4
+ # Store SCSS files (by default) within 'app/stylesheets'.
5
+ require 'sass/plugin/rack'
6
+ Sass::Plugin.options[:syntax] = :scss
7
+ Sass::Plugin.options[:template_location] = Tennpipes.root("app/stylesheets")
8
+ Sass::Plugin.options[:css_location] = Tennpipes.root("public/stylesheets")
9
+ app.use Sass::Plugin::Rack
10
+ SCSS
11
+
12
+ def setup_stylesheet
13
+ require_dependencies 'sass'
14
+ initializer :scss, SCSS_INIT.chomp
15
+ empty_directory destination_root('/app/stylesheets')
16
+ end
@@ -0,0 +1,103 @@
1
+ BACON_SETUP = (<<-TEST).gsub(/^ {10}/, '') unless defined?(BACON_SETUP)
2
+ RACK_ENV = 'test' unless defined?(RACK_ENV)
3
+ require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
4
+ Dir[File.expand_path(File.dirname(__FILE__) + "/../app/helpers/**/*.rb")].each(&method(:require))
5
+
6
+ class Bacon::Context
7
+ include Rack::Test::Methods
8
+ end
9
+
10
+ # You can use this method to custom specify a Rack app
11
+ # you want rack-test to invoke:
12
+ #
13
+ # app CLASS_NAME
14
+ # app CLASS_NAME.tap { |a| }
15
+ # app(CLASS_NAME) do
16
+ # set :foo, :bar
17
+ # end
18
+ #
19
+ def app(app = nil, &blk)
20
+ @app ||= block_given? ? app.instance_eval(&blk) : app
21
+ @app ||= Tennpipes.application
22
+ end
23
+ TEST
24
+
25
+ BACON_CONTROLLER_TEST = (<<-TEST).gsub(/^ {10}/, '') unless defined?(BACON_CONTROLLER_TEST)
26
+ require File.expand_path(File.dirname(__FILE__) + '/../../test_config.rb')
27
+
28
+ describe "!PATH!" do
29
+ it 'returns text at root' do
30
+ get "!EXPANDED_PATH!"
31
+ last_response.body.should == "some text"
32
+ end
33
+ end
34
+ TEST
35
+
36
+ BACON_RAKE = (<<-TEST).gsub(/^ {10}/, '') unless defined?(BACON_RAKE)
37
+ require 'rake/testtask'
38
+
39
+ test_tasks = Dir['test/*/'].map { |d| File.basename(d) }
40
+
41
+ test_tasks.each do |folder|
42
+ Rake::TestTask.new("test:\#{folder}") do |test|
43
+ test.pattern = "test/\#{folder}/**/*_test.rb"
44
+ test.verbose = true
45
+ end
46
+ end
47
+
48
+ desc "Run application test suite"
49
+ task 'test' => test_tasks.map { |f| "test:\#{f}" }
50
+ TEST
51
+
52
+ BACON_MODEL_TEST = (<<-TEST).gsub(/^ {10}/, '') unless defined?(BACON_MODEL_TEST)
53
+ require File.expand_path(File.dirname(__FILE__) + '!PATH!/test_config.rb')
54
+
55
+ describe "!NAME! Model" do
56
+ it 'can be created' do
57
+ @!DNAME! = !NAME!.new
58
+ @!DNAME!.should.not.be.nil
59
+ end
60
+ end
61
+ TEST
62
+
63
+ BACON_HELPER_TEST = <<-TEST unless defined?(BACON_HELPER_TEST)
64
+ require File.expand_path(File.dirname(__FILE__) + '!PATH!/test_config.rb')
65
+
66
+ describe "!NAME!" do
67
+ before do
68
+ @helpers = Class.new
69
+ @helpers.extend !NAME!
70
+ end
71
+
72
+ it "should return nil" do
73
+ @helpers.foo.should.equal nil
74
+ end
75
+ end
76
+ TEST
77
+
78
+ def setup_test
79
+ require_dependencies 'rack-test', :require => 'rack/test', :group => 'test'
80
+ require_dependencies 'bacon', :group => 'test'
81
+ insert_test_suite_setup BACON_SETUP, :path => 'test/test_config.rb'
82
+ create_file destination_root("test/test.rake"), BACON_RAKE
83
+ end
84
+
85
+ def generate_controller_test(name, path)
86
+ bacon_contents = BACON_CONTROLLER_TEST.gsub(/!PATH!/, path).gsub(/!EXPANDED_PATH!/, path.gsub(/:\w+?_id/, "1"))
87
+ controller_test_path = File.join('test',options[:app],'controllers',"#{name.to_s.underscore}_controller_test.rb")
88
+ create_file destination_root(controller_test_path), bacon_contents, :skip => true
89
+ end
90
+
91
+ def generate_model_test(name)
92
+ bacon_contents = BACON_MODEL_TEST.gsub(/!NAME!/, name.to_s.underscore.camelize).gsub(/!DNAME!/, name.to_s.underscore)
93
+ bacon_contents.gsub!(/!PATH!/, recognize_path)
94
+ model_test_path = File.join('test',options[:app],'models',"#{name.to_s.underscore}_test.rb")
95
+ create_file destination_root(model_test_path), bacon_contents, :skip => true
96
+ end
97
+
98
+ def generate_helper_test(name, project_name, app_name)
99
+ bacon_contents = BACON_HELPER_TEST.gsub(/!NAME!/, "#{project_name}::#{app_name}::#{name}")
100
+ bacon_contents.gsub!(/!PATH!/, recognize_path)
101
+ helper_spec_path = File.join('test', options[:app], 'helpers', "#{name.underscore}_test.rb")
102
+ create_file destination_root(helper_spec_path), bacon_contents, :skip => true
103
+ end