beet 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -8,4 +8,5 @@ platforms :ruby do
8
8
  end
9
9
  end
10
10
 
11
+ gem "activesupport", "~> 3.0.0"
11
12
  gem "thor", "~> 0.14.0"
data/TODO CHANGED
@@ -17,3 +17,9 @@ and want to verify things worked correctly
17
17
  * in fact, maybe make a .beetrc file where you can set a prefix permanently.
18
18
 
19
19
  * use aruba to test beet - http://github.com/aslakhellesoy/aruba
20
+
21
+ * write recipes for
22
+ * multiple file uploads
23
+ * facebook connect with devise - http://stackoverflow.com/questions/3580557/rails-3-using-devise-how-to-allow-someone-to-log-in-using-their-facebook-account
24
+
25
+ * add in a "recipe not found: #{recipe}" so when things don't run it doesn't silently fail
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.6
1
+ 0.6.7
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{beet}
8
- s.version = "0.6.6"
8
+ s.version = "0.6.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jack Dempsey"]
12
- s.date = %q{2010-09-07}
12
+ s.date = %q{2010-09-09}
13
13
  s.default_executable = %q{beet}
14
14
  s.email = %q{jack.dempsey@gmail.com}
15
15
  s.executables = ["beet"]
@@ -72,6 +72,7 @@ Gem::Specification.new do |s|
72
72
  "lib/beet/recipes/rails3/clean_files.rb",
73
73
  "lib/beet/recipes/rails3/css/reset.rb",
74
74
  "lib/beet/recipes/rails3/db/mysql.rb",
75
+ "lib/beet/recipes/rails3/file_uploads/paperclip.rb",
75
76
  "lib/beet/recipes/rails3/git.rb",
76
77
  "lib/beet/recipes/rails3/js/jquery.rb",
77
78
  "lib/beet/recipes/rails3/testing/cucumber.rb",
@@ -8,3 +8,6 @@ require 'beet/scm'
8
8
  require 'beet/executor'
9
9
  require 'beet/gem_location_map'
10
10
  require 'beet/template_location_map'
11
+
12
+ # for camelize and others
13
+ require 'active_support/core_ext/string/inflections'
@@ -1,13 +1,10 @@
1
1
  # install plugins
2
2
  #
3
3
  plugin 'active_scaffold', :git => 'git://github.com/vhochstein/active_scaffold.git'
4
- plugin 'verification', :git => 'git://github.com/rails/verification.git'
5
- plugin 'render_component', :git => 'git://github.com/vhochstein/render_component.git'
6
-
7
- # configure as much as we can automatically
8
- add_after 'app/views/layouts/application.html.erb',' <%= csrf_meta_tag %>', ' <%= active_scaffold_includes %>'
9
4
 
10
5
  if yes?("Use jquery? (y/n):")
11
- gsub_file 'vendor/plugins/active_scaffold/environment.rb', /#ActiveScaffold.js_framework = :jquery/, 'ActiveScaffold.js_framework = :jquery'
6
+ generate "active_scaffold_setup jquery"
7
+ else
8
+ generate "active_scaffold_setup"
12
9
  end
13
10
 
@@ -0,0 +1,29 @@
1
+ gem 'paperclip'
2
+
3
+ model_name = ask "Name of the model to add an attachment to, e.g. user_profile"
4
+ attachment_name = ask "Name for the attached file, e.g. has_attached_file :avatar"
5
+ underscored_model_name = model_name.underscore
6
+
7
+ in_root do
8
+ if File.exists?("app/models/#{model_name}.rb")
9
+ table_name = underscored_model_name.pluralize
10
+
11
+ generate "migration add_#{attachment_name}_to_#{table_name}"
12
+ migration_file = Dir["db/migrate/*add_#{attachment_name}_to_#{table_name}*"].first
13
+ add_after "db/migrate/#{migration_file}.rb", 'def self.up', do
14
+ %{
15
+ add_column :#{table_name}, #{attachment_name}_file_name:string
16
+ add_column :#{table_name}, #{attachment_name}_content_type:string
17
+ add_column :#{table_name}, #{attachment_name}_file_size:integer
18
+ add_column :#{table_name}, #{attachment_name}_updated_at:datetime
19
+ }
20
+ end
21
+ else
22
+ generate "model #{model_name} #{attachment_name}_file_name:string #{attachment_name}_content_type:string #{attachment_name}_file_size:integer #{attachment_name}_updated_at:datetime"
23
+ end
24
+
25
+ add_after "app/models/#{underscored_model_name}.rb", "class #{model_name.camelize} < ActiveRecord::Base", "has_attached_file :#{attachment_name}, :styles => { :thumb => '50x' }"
26
+
27
+ end
28
+
29
+ rake "db:migrate"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 6
9
- version: 0.6.6
8
+ - 7
9
+ version: 0.6.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jack Dempsey
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-07 00:00:00 -04:00
17
+ date: 2010-09-09 00:00:00 -04:00
18
18
  default_executable: beet
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -96,6 +96,7 @@ files:
96
96
  - lib/beet/recipes/rails3/clean_files.rb
97
97
  - lib/beet/recipes/rails3/css/reset.rb
98
98
  - lib/beet/recipes/rails3/db/mysql.rb
99
+ - lib/beet/recipes/rails3/file_uploads/paperclip.rb
99
100
  - lib/beet/recipes/rails3/git.rb
100
101
  - lib/beet/recipes/rails3/js/jquery.rb
101
102
  - lib/beet/recipes/rails3/testing/cucumber.rb