app_drone 0.11.3 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in app_drone.gemspec
4
4
  gemspec
5
+ gem 'rake'
@@ -4,42 +4,20 @@ class Bootstrap < Drone
4
4
  desc "Installs Twitter Bootstrap stylesheets and javascripts"
5
5
  category :ui
6
6
 
7
- #param :vendor, :boolean, info: 'place a local copy of the files into the repo for customization'
8
-
9
7
  param :responsive, :boolean, info: 'include responsive grid'
10
- param :font_awesome, :boolean, info: 'use font-awesome for icons', default: true
8
+ param :font_awesome, :boolean, info: 'use font-awesome for icons'#, default: true
11
9
  param :javascript_plugins, :choose_many, info: 'pipeline javascript plugin files', default: [], choices: %w(modal dropdown scrollspy tab tooltip popover alert button collapse carousel typeahead)
12
10
 
13
11
  depends_on :bundle, :stylesheet, :javascript
14
12
  pairs_with :flair
15
13
 
16
14
  def align
17
- bundle.add 'compass_twitter_bootstrap', git: 'git://github.com/vwall/compass-twitter-bootstrap.git', group: :assets
18
- false ? align_vendor : align_bundle
19
- flair!
20
- end
21
-
22
- def execute
23
- false ? execute_vendor : execute_bundle
24
- end
25
-
26
- private
27
- def align_vendor
28
- # TODO import paths for stylesheet (different to bundle)
29
- param(:javascript_plugins).each { |p| javascript.pipeline "bootstrap-#{p}" }
30
- end
31
-
32
- def align_bundle
33
- stylesheet.import param(:font_awesome) ? 'compass_twitter_bootstrap_awesome' : 'compass_twitter_bootstrap'
34
- stylesheet.import 'compass_twitter_bootstrap_responsive' if param(:responsive)
15
+ bundle.add 'bootstrap-sass', group: :assets
16
+ bundle.add 'font-awesome-sass-rails', group: :assets if param(:font_awesome)
17
+ stylesheet.import 'bootstrap'
18
+ stylesheet.import 'font-awesome' if param(:font_awesome)
35
19
  param(:javascript_plugins).each { |p| javascript.pipeline "bootstrap-#{p}" }
36
- end
37
-
38
- def execute_vendor
39
- # TODO pull files from git
40
- end
41
-
42
- def execute_bundle
20
+ flair!
43
21
  end
44
22
 
45
23
  end
@@ -1,3 +1,3 @@
1
1
  git :init
2
2
  git add: '.'
3
- git commit: "-m \"AppDrone: #{app_name}\""
3
+ git commit: "-m \"#{app_name} | http://drone.bz\""
@@ -0,0 +1,17 @@
1
+ module AppDrone
2
+ class Gon < Drone
3
+ desc "Growl-like notifications for jQuery"
4
+ category :controller
5
+
6
+ depends_on :bundle, :javascript
7
+ pairs_with :slim_view
8
+
9
+ def align
10
+ bundle.add 'gon'
11
+ end
12
+
13
+ def execute
14
+ end
15
+
16
+ end
17
+ end
@@ -9,7 +9,8 @@ haml_index_path = File.join %w(app views layouts application.html.haml)
9
9
  = stylesheet_link_tag 'application', media: 'all'
10
10
  = javascript_include_tag 'application'
11
11
  = csrf_meta_tags
12
-
12
+ <% if pair?(:gon) %> = include_gon
13
+ <% end %>
13
14
  %body{:class => controller_name}
14
15
  = yield
15
16
  HAML
@@ -4,6 +4,7 @@ class HamlView < Drone
4
4
 
5
5
  category :views
6
6
  depends_on :bundle
7
+ pairs_with :gon
7
8
 
8
9
  def align
9
10
  bundle.add 'haml-rails'
@@ -1,7 +1,7 @@
1
1
  module AppDrone
2
2
  class Html5PlaceholderShim < Drone
3
3
  desc "HTML5 placeholder support for older browsers"
4
- category :ui_shim
4
+ category :shim
5
5
 
6
6
  depends_on :javascript, :git
7
7
 
@@ -0,0 +1,13 @@
1
+ module AppDrone
2
+ class QuietAssets < Drone
3
+ desc "Silences console logging for assets in development"
4
+ category :misc
5
+
6
+ depends_on :bundle
7
+
8
+ def align
9
+ bundle.add 'quiet_assets', group: :development
10
+ end
11
+
12
+ end
13
+ end
@@ -9,7 +9,8 @@ html
9
9
  = stylesheet_link_tag 'application', media: 'all'
10
10
  = javascript_include_tag 'application'
11
11
  = csrf_meta_tags
12
-
12
+ <% if pair?(:gon) %> = include_gon
13
+ <% end %>
13
14
  body class=controller_name
14
15
  = yield
15
16
  SLIM
@@ -4,6 +4,7 @@ class SlimView < Drone
4
4
  # TODO integration with rack useragent for browser-detection
5
5
  category :base
6
6
  depends_on :bundle
7
+ pairs_with :gon
7
8
 
8
9
  def align
9
10
  bundle.add 'slim-rails'
@@ -0,0 +1,13 @@
1
+ module AppDrone
2
+ class StrongParameters < Drone
3
+ desc "Better parameter / mass-assignment protection"
4
+ category :controller
5
+
6
+ depends_on :bundle
7
+
8
+ def align
9
+ bundle.add 'strong_parameters'
10
+ end
11
+
12
+ end
13
+ end
@@ -20,7 +20,7 @@ class Template
20
20
  raise "No such drone: #{klass}" unless i_klass = @drones[klass]
21
21
  return i_klass
22
22
  end
23
-
23
+
24
24
  def leftover_directives; @directives[:leftovers] end
25
25
  def generator_methods; @directives.keys - [:leftovers] end
26
26
  def overridable_generator_methods; [:gemfile] end
@@ -38,7 +38,7 @@ class Template
38
38
  def notify!(notice,drone)
39
39
  @drone_notices[drone.class] << notice.gsub("'","\\'").gsub('"','\\"') # escape quotes
40
40
  end
41
-
41
+
42
42
  def render!
43
43
  return if @rendered
44
44
  DependencyChain.check_dependencies!(drone_classes)
@@ -1,3 +1,3 @@
1
1
  module AppDrone
2
- VERSION = '0.11.3'
2
+ VERSION = '0.12.0'
3
3
  end
data/out.rb CHANGED
@@ -25,7 +25,9 @@ class AppBuilder < Rails::AppBuilder
25
25
  # ---
26
26
  @generator.gem 'therubyracer'
27
27
  @generator.gem 'compass-rails'
28
- @generator.gem 'haml-rails'
28
+ @generator.gem 'slim-rails'
29
+ @generator.gem 'high_voltage'
30
+ @generator.gem 'quiet_assets', :group=>:development
29
31
 
30
32
  run_bundle
31
33
  @generator.options = @generator.options.dup
@@ -72,30 +74,44 @@ COFFEE
72
74
  SASS
73
75
 
74
76
  # ---
75
- # AppDrone::Cleanup
76
- # ---
77
- @generator.remove_file File.join %w(public index.html)
78
- @generator.remove_file File.join %w(app assets images rails.png)
79
- @generator.remove_file File.join %w(README.rdoc)
80
-
81
- # ---
82
- # AppDrone::HamlView
77
+ # AppDrone::SlimView
83
78
  # ---
84
79
  erb_index_path = File.join %w(app views layouts application.html.erb)
85
80
  @generator.remove_file(erb_index_path)
86
- haml_index_path = File.join %w(app views layouts application.html.haml)
87
- @generator.create_file haml_index_path, <<-HAML
88
- !!!
89
- %html
90
- %head
91
- %title #{app_name}
81
+ slim_index_path = File.join %w(app views layouts application.html.slim)
82
+ @generator.create_file slim_index_path, <<-SLIM
83
+ doctype 5
84
+ html
85
+ head
86
+ title #{app_name}
92
87
  = stylesheet_link_tag 'application', media: 'all'
93
88
  = javascript_include_tag 'application'
94
89
  = csrf_meta_tags
95
90
 
96
- %body{:class => controller_name}
91
+ body class=controller_name
97
92
  = yield
98
- HAML
93
+ SLIM
94
+
95
+ # ---
96
+ # AppDrone::HighVoltage
97
+ # ---
98
+ FileUtils.mkpath 'app/views/pages'
99
+
100
+ # ---
101
+ # AppDrone::Flair
102
+ # ---
103
+ @generator.create_file 'app/views/pages/flair.html.slim', <<-FLAIR
104
+ h1 Flair!
105
+
106
+
107
+ FLAIR
108
+
109
+ # ---
110
+ # AppDrone::Cleanup
111
+ # ---
112
+ @generator.remove_file File.join %w(public index.html)
113
+ @generator.remove_file File.join %w(app assets images rails.png)
114
+ @generator.remove_file File.join %w(README.rdoc)
99
115
 
100
116
 
101
117
  # This should be removed when the database drone is installed
@@ -23,7 +23,7 @@ class AppDroneTest < Test::Unit::TestCase
23
23
  def test_basic_behavior
24
24
  template = Template.new
25
25
  add_defaults_to_template(template)
26
-
26
+ template.add :quiet_assets
27
27
  # template.add :new_drone_to_test
28
28
 
29
29
  template.render_to_file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_drone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.12.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-16 00:00:00.000000000 Z
12
+ date: 2012-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &18962340 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,12 @@ dependencies:
21
21
  version: 3.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *18962340
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.0
25
30
  description: Give your Rails apps a kickstart
26
31
  email:
27
32
  - whoisdanieldavey@gmail.com
@@ -65,6 +70,7 @@ files:
65
70
  - lib/app_drone/drones/git/commit.erb
66
71
  - lib/app_drone/drones/git/fetch.erb
67
72
  - lib/app_drone/drones/git/git.rb
73
+ - lib/app_drone/drones/gon/gon.rb
68
74
  - lib/app_drone/drones/gritter/flair.html.slim.erb
69
75
  - lib/app_drone/drones/gritter/gritter.rb
70
76
  - lib/app_drone/drones/gritter/install.erb
@@ -84,6 +90,7 @@ files:
84
90
  - lib/app_drone/drones/new_relic/new_relic.rb
85
91
  - lib/app_drone/drones/nifty_generators/nifty_config.erb
86
92
  - lib/app_drone/drones/nifty_generators/nifty_generators.rb
93
+ - lib/app_drone/drones/quiet_assets/quiet_assets.rb
87
94
  - lib/app_drone/drones/ranked_model/ranked_model.rb
88
95
  - lib/app_drone/drones/remotipart/remotipart.rb
89
96
  - lib/app_drone/drones/responders/install.erb
@@ -102,6 +109,7 @@ files:
102
109
  - lib/app_drone/drones/squeel/initializer.erb
103
110
  - lib/app_drone/drones/squeel/squeel.rb
104
111
  - lib/app_drone/drones/stateflow/stateflow.rb
112
+ - lib/app_drone/drones/strong_parameters/strong_parameters.rb
105
113
  - lib/app_drone/drones/stylesheet/application_sass.erb
106
114
  - lib/app_drone/drones/stylesheet/stylesheet.rb
107
115
  - lib/app_drone/drones/timecop/timecop.rb
@@ -138,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
146
  version: '0'
139
147
  requirements: []
140
148
  rubyforge_project:
141
- rubygems_version: 1.8.10
149
+ rubygems_version: 1.8.23
142
150
  signing_key:
143
151
  specification_version: 3
144
152
  summary: Generates Rails templates to help start your app on good footing