jackdempsey-beet 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -8,6 +8,12 @@ your project needs.
8
8
 
9
9
  Eventually I would love to see strategies/templates for sinatra, merb, iPhone apps, etc. The sky is the limit.
10
10
 
11
+ == Existing Templates
12
+
13
+ Beet should be compatible with existing rails templates. For instance, to use the daring.rb template, you can run:
14
+
15
+ beet generate new_daring_project --templates http://github.com/jeremymcanally/rails-templates/raw/10f5bc25e4067968dcf3e950a95538dcbc1f79ed/daring.rb
16
+
11
17
  == Copyright
12
18
 
13
19
  Copyright (c) 2009 Jack Dempsey. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/beet.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{beet}
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jack Dempsey"]
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
33
33
  "lib/beet/scm.rb",
34
34
  "lib/beet/scm/git.rb",
35
35
  "lib/beet/scm/svn.rb",
36
+ "lib/beet/templates/rails/authlogic.rb",
36
37
  "lib/beet/templates/rails/clean_files.rb",
37
38
  "lib/beet/templates/rails/git.rb",
38
39
  "lib/beet/templates/rails/jquery.rb",
data/lib/beet/executor.rb CHANGED
@@ -19,12 +19,9 @@ module Beet
19
19
  @root = File.expand_path(File.join(Dir.pwd, app_name))
20
20
  @templates = []
21
21
  templates.split(/[\s,]+/).each do |template|
22
- @templates << (if !File.exists?(template) and !template.include?('http')
23
- # they're trying to use a named template from the templates directory
24
- File.expand_path(File.join(File.dirname(__FILE__), 'templates', "#{template}.rb"))
25
- else
26
- template
27
- end)
22
+ if file = template_location(template)
23
+ @templates << file
24
+ end
28
25
  end
29
26
  end
30
27
 
@@ -39,5 +36,17 @@ module Beet
39
36
  end
40
37
  end
41
38
 
39
+ private
40
+
41
+ def template_location(template)
42
+ return template if File.exists?(template) or template.include?('http://')
43
+ locations = []
44
+ locations << File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
45
+ locations << File.expand_path(ENV['BEET_TEMPLATES_DIR']) if ENV['BEET_TEMPLATES_DIR']
46
+ locations.each do |location|
47
+ filename = File.join(location, "#{template}.rb")
48
+ return filename if File.exists?(filename)
49
+ end
50
+ end
42
51
  end
43
52
  end
@@ -0,0 +1,8 @@
1
+ # app/models/user_session.rb
2
+ file "app/models/user_session.rb" do
3
+ %q{
4
+ class UserSession < Authlogic::Session::Base
5
+ # configuration here, see documentation for sub modules of Authlogic::Session
6
+ end
7
+ }
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jackdempsey-beet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Dempsey
@@ -41,6 +41,7 @@ files:
41
41
  - lib/beet/scm.rb
42
42
  - lib/beet/scm/git.rb
43
43
  - lib/beet/scm/svn.rb
44
+ - lib/beet/templates/rails/authlogic.rb
44
45
  - lib/beet/templates/rails/clean_files.rb
45
46
  - lib/beet/templates/rails/git.rb
46
47
  - lib/beet/templates/rails/jquery.rb