beet 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.7
1
+ 0.6.8
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{beet}
8
- s.version = "0.6.7"
8
+ s.version = "0.6.8"
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-09}
12
+ s.date = %q{2010-09-18}
13
13
  s.default_executable = %q{beet}
14
14
  s.email = %q{jack.dempsey@gmail.com}
15
15
  s.executables = ["beet"]
@@ -68,6 +68,7 @@ Gem::Specification.new do |s|
68
68
  "lib/beet/recipes/rails/testing/rspec.rb",
69
69
  "lib/beet/recipes/rails/testing/shoulda.rb",
70
70
  "lib/beet/recipes/rails3/admin_interface/active_scaffold.rb",
71
+ "lib/beet/recipes/rails3/admin_interface/rails_admin.rb",
71
72
  "lib/beet/recipes/rails3/auth/devise.rb",
72
73
  "lib/beet/recipes/rails3/clean_files.rb",
73
74
  "lib/beet/recipes/rails3/css/reset.rb",
@@ -77,6 +78,7 @@ Gem::Specification.new do |s|
77
78
  "lib/beet/recipes/rails3/js/jquery.rb",
78
79
  "lib/beet/recipes/rails3/testing/cucumber.rb",
79
80
  "lib/beet/recipes/rails3/testing/rspec.rb",
81
+ "lib/beet/recipes/standalone/hades.rb",
80
82
  "lib/beet/scm.rb",
81
83
  "lib/beet/scm/git.rb",
82
84
  "lib/beet/scm/svn.rb",
data/bin/beet CHANGED
@@ -3,9 +3,7 @@
3
3
  require 'rubygems'
4
4
  require 'thor'
5
5
  begin
6
- if RUBY_VERSION <= '1.8.6'
7
- require 'ruby-debug'
8
- end
6
+ require 'ruby-debug'
9
7
  rescue LoadError
10
8
  end
11
9
  $:.unshift(File.dirname(__FILE__) + '/../lib')
@@ -7,24 +7,20 @@ module Beet
7
7
  #
8
8
  # ==== Examples
9
9
  #
10
- # file("lib/fun_party.rb") do
11
- # hostname = ask("What is the virtual hostname I should use?")
12
- # "vhost.name = #{hostname}"
13
- # end
14
- #
15
- # file("config/apach.conf", "your apache config")
10
+ # file("lib/fun_party.rb") do
11
+ # hostname = ask("What is the virtual hostname I should use?")
12
+ # "vhost.name = #{hostname}"
13
+ # end
16
14
  #
15
+ # file("config/apach.conf", "your apache config")
17
16
  def file(filename, data = nil, log_action = true, &block)
18
17
  log 'file', filename if log_action
19
18
  dir, file = [File.dirname(filename), File.basename(filename)]
20
19
 
21
20
  inside(dir) do
22
21
  File.open(file, "w") do |f|
23
- if block_given?
24
- f.write(block.call)
25
- else
26
- f.write(data)
27
- end
22
+ data = block.call if block_given?
23
+ f.write(remove_blank_start(data))
28
24
  end
29
25
  end
30
26
  end
@@ -153,5 +149,15 @@ module Beet
153
149
  File.join(root, relative_destination)
154
150
  end
155
151
 
152
+ # it's common for multi-line strings to be coded in a way so that their first character is a newline
153
+ # like this
154
+ # string = %{
155
+ # foo
156
+ # }
157
+ # string => "\nfoo\n"
158
+ # This is bad when it needs to be #!/usr/bin/something so we remove that newline in a dumb but effective way for now
159
+ def remove_blank_start(string)
160
+ string.reverse.chomp.reverse
161
+ end
156
162
  end
157
163
  end
@@ -63,6 +63,10 @@ module Beet
63
63
  # Passes gem info along to gemfile method that handles adding it in
64
64
  def gem(name, options = {})
65
65
  log 'gem', name
66
+ if File.read("Gemfile").include?(name)
67
+ log "Error", "File matches on '#{name}'. Skipping for now."
68
+ return
69
+ end
66
70
  group = options.delete(:group) || @_gem_group
67
71
  version = options.delete(:version)
68
72
 
@@ -0,0 +1,6 @@
1
+ gem 'devise'
2
+ gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
3
+
4
+ run "bundle update"
5
+
6
+ generate "rails_admin:install_admin"
@@ -0,0 +1,61 @@
1
+ require 'fileutils'
2
+ require 'active_support/core_ext/string/inflections'
3
+
4
+ run "gem install thin" if `which thin` == ''
5
+ run "gem install jeweler" if `which jeweler` == ''
6
+ run "gem install sinatra" if `gem list sinatra | grep sinatra` == ''
7
+
8
+ name = ask "Project name: "
9
+ run "jeweler #{name}"
10
+
11
+ file "#{name}/bin/#{name}" do
12
+ %{
13
+ #!/usr/bin/env ruby
14
+
15
+ # #{name} command line interface script.
16
+ # Run #{name} -h to get more usage.
17
+ # inspired by Dave Hrycyszyn
18
+ # http://labs.headlondon.com/2010/07/skinny-daemons/
19
+
20
+ require File.expand_path(File.join(*%w[.. .. lib #{name}]), __FILE__)
21
+ require 'thin'
22
+
23
+ rackup_file = File.expand_path(File.join(File.dirname(__FILE__), *%w[.. lib #{name} config.ru]))
24
+
25
+ argv = ARGV
26
+ argv << ["-R", rackup_file] unless ARGV.include?("-R")
27
+ argv << ["-p", "2003"] unless ARGV.include?("-p")
28
+ argv << ["-e", "production"] unless ARGV.include?("-e")
29
+ Thin::Runner.new(argv.flatten).run!
30
+ }
31
+ end
32
+
33
+ FileUtils.chmod 0755, "#{name}/bin/#{name}"
34
+
35
+ file "#{name}/lib/#{name}/config.ru" do
36
+ %{
37
+ require File.dirname(__FILE__) + '/../#{name}'
38
+ #{name.camelize}.run! :port => 2003
39
+ }
40
+ end
41
+
42
+ file "#{name}/lib/#{name}.rb" do
43
+ %{
44
+ require 'rubygems'
45
+ require 'sinatra/base'
46
+
47
+ class #{name.camelize} < Sinatra::Base
48
+ # This can display a nice status message.
49
+ #
50
+ get "/" do
51
+ "#{name.titleize} is up and running."
52
+ end
53
+
54
+ # This POST allows your other apps to control the service.
55
+ #
56
+ post "/do-something/:great" do
57
+ # something great could happen here
58
+ end
59
+ end
60
+ }
61
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 7
9
- version: 0.6.7
8
+ - 8
9
+ version: 0.6.8
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-09 00:00:00 -04:00
17
+ date: 2010-09-18 00:00:00 -04:00
18
18
  default_executable: beet
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -92,6 +92,7 @@ files:
92
92
  - lib/beet/recipes/rails/testing/rspec.rb
93
93
  - lib/beet/recipes/rails/testing/shoulda.rb
94
94
  - lib/beet/recipes/rails3/admin_interface/active_scaffold.rb
95
+ - lib/beet/recipes/rails3/admin_interface/rails_admin.rb
95
96
  - lib/beet/recipes/rails3/auth/devise.rb
96
97
  - lib/beet/recipes/rails3/clean_files.rb
97
98
  - lib/beet/recipes/rails3/css/reset.rb
@@ -101,6 +102,7 @@ files:
101
102
  - lib/beet/recipes/rails3/js/jquery.rb
102
103
  - lib/beet/recipes/rails3/testing/cucumber.rb
103
104
  - lib/beet/recipes/rails3/testing/rspec.rb
105
+ - lib/beet/recipes/standalone/hades.rb
104
106
  - lib/beet/scm.rb
105
107
  - lib/beet/scm/git.rb
106
108
  - lib/beet/scm/svn.rb