Permalink
Browse files

Merge branch 'sinatra-authlogic' of github.com:winton/gem_template

Conflicts:
	Rakefile
	require.rb
	script/console
	spec/spec_helper.rb
  • Loading branch information...
2 parents 94fc463 + 6e868bf commit 07b904f18c5b422eef71eafe046ce153f9ddd348 @winton committed Jul 5, 2010
View
@@ -1,7 +1,6 @@
.DS_Store
.sass-cache
*.gem
-*.gemspec
*.log
config/cloud_info.yml
config/database.yml
View
62 Gemfile
@@ -0,0 +1,62 @@
+source "http://rubygems.org"
+
+v = {
+ :active_wrapper => '=0.2.7',
+ :bundler => '=1.0.0.beta.2',
+ :cucumber => '=0.6.2',
+ :haml => '=2.2.17',
+ :lilypad => '=0.3.0',
+ :newrelic_rpm => '=2.10.6',
+ :rack_test => '=0.5.3',
+ :rake => '=0.8.7',
+ :rspec => '=1.3.0',
+ :sinatra => '=1.0',
+ :with_pid => '=0.1.2'
+}
+
+group :console do
+ gem 'active_wrapper', v[:active_wrapper], :require => %w(active_wrapper)
+ gem 'sinatra', v[:sinatra], :require => %w(sinatra/base)
+end
+
+group :dj do
+ gem 'with_pid', v[:with_pid], :require => %w(with_pid)
+end
+
+group :gemspec do
+ gem 'active_wrapper', v[:active_wrapper], :require => %w(active_wrapper)
+ gem 'bundler', v[:bundler]
+ gem 'haml', v[:haml]
+ gem 'lilypad', v[:lilypad]
+ gem 'sinatra', v[:sinatra]
+end
+
+group :gemspec_dev do
+ gem 'cucumber', v[:cucumber]
+ gem 'rspec', v[:rspec]
+ gem 'rack-test', v[:rack_test]
+end
+
+group :lib do
+ gem 'active_wrapper', v[:active_wrapper], :require => %w(active_wrapper)
+ gem 'haml', v[:haml], :require => %w(haml sass)
+ gem 'lilypad', v[:lilypad], :require => %w(lilypad)
+ gem 'newrelic_rpm', v[:newrelic_rpm], :require => %w(newrelic_rpm)
+ gem 'rack-flash', v[:rack_flash], :require => %w(rack-flash)
+ gem 'sinatra', v[:sinatra], :require => %w(sinatra/base)
+end
+
+group :rake do
+ gem 'active_wrapper', v[:active_wrapper], :require => %w(active_wrapper/tasks)
+ gem 'rake', v[:rake], :require => %w(rake rake/gempackagetask)
+ gem 'rspec', v[:rspec], :require => %w(spec/rake/spectask)
+end
+
+group :spec do
+ gem 'rack-test', v[:rack_test], :require => %w(rack/test)
+ gem 'rspec', v[:rspec], :require => %w(
+ spec/adapters/mock_frameworks/rspec
+ spec/runner/formatter/progress_bar_formatter
+ spec/runner/formatter/text_mate_formatter
+ )
+end
View
@@ -0,0 +1,105 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (2.3.5)
+ actionpack (= 2.3.5)
+ actionmailer (2.3.5)
+ actionpack (= 2.3.5)
+ actionpack (2.3.5)
+ activesupport (= 2.3.5)
+ rack (~> 1.0.0)
+ actionpack (2.3.5)
+ activesupport (= 2.3.5)
+ rack (~> 1.0.0)
+ active_wrapper (0.2.7)
+ actionmailer (= 2.3.5)
+ activerecord (= 2.3.5)
+ active_wrapper (0.2.7)
+ actionmailer (= 2.3.5)
+ activerecord (= 2.3.5)
+ activerecord (2.3.5)
+ activesupport (= 2.3.5)
+ activerecord (2.3.5)
+ activesupport (= 2.3.5)
+ activesupport (2.3.5)
+ activesupport (2.3.5)
+ builder (2.1.2)
+ builder (2.1.2)
+ cucumber (0.6.2)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ json_pure (>= 1.2.0)
+ polyglot (>= 0.2.9)
+ term-ansicolor (>= 1.0.4)
+ treetop (>= 1.4.2)
+ cucumber (0.6.2)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ json_pure (>= 1.2.0)
+ polyglot (>= 0.2.9)
+ term-ansicolor (>= 1.0.4)
+ treetop (>= 1.4.2)
+ diff-lcs (1.1.2)
+ diff-lcs (1.1.2)
+ haml (2.2.17)
+ haml (2.2.17)
+ json_pure (1.2.0)
+ json_pure (1.2.0)
+ lilypad (0.3.0)
+ builder (>= 2.1.2)
+ lilypad (0.3.0)
+ builder (>= 2.1.2)
+ newrelic_rpm (2.10.6)
+ newrelic_rpm (2.10.6)
+ polyglot (0.2.9)
+ polyglot (0.2.9)
+ rack (1.0.1)
+ rack (1.0.1)
+ rack-flash (0.1.1)
+ rack
+ rack-flash (0.1.1)
+ rack
+ rack-test (0.5.3)
+ rack (>= 1.0)
+ rack-test (0.5.3)
+ rack (>= 1.0)
+ rake (0.8.7)
+ rake (0.8.7)
+ rspec (1.3.0)
+ rspec (1.3.0)
+ sinatra (1.0)
+ rack (>= 1.0)
+ sinatra (1.0)
+ rack (>= 1.0)
+ term-ansicolor (1.0.4)
+ term-ansicolor (1.0.4)
+ treetop (1.4.3)
+ polyglot (>= 0.2.5)
+ treetop (1.4.3)
+ polyglot (>= 0.2.5)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ active_wrapper (= 0.2.7)
+ active_wrapper (= 0.2.7)
+ active_wrapper (= 0.2.7)
+ active_wrapper (= 0.2.7)
+ bundler (= 1.0.0.beta.2)
+ cucumber (= 0.6.2)
+ haml (= 2.2.17)
+ haml (= 2.2.17)
+ lilypad (= 0.3.0)
+ lilypad (= 0.3.0)
+ newrelic_rpm (= 2.10.6)
+ rack-flash
+ rack-test (= 0.5.3)
+ rack-test (= 0.5.3)
+ rake (= 0.8.7)
+ rspec (= 1.3.0)
+ rspec (= 1.3.0)
+ rspec (= 1.3.0)
+ sinatra (= 1.0)
+ sinatra (= 1.0)
+ sinatra (= 1.0)
View
@@ -1,4 +1,4 @@
-Copyright (c) 2009 Winton Welsh
+Copyright (c) 2010 Winton Welsh
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@@ -15,4 +15,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
File renamed without changes.
View
@@ -1,9 +1,75 @@
-require "#{File.dirname(__FILE__)}/require"
-Require.rakefile!
+require 'rubygems'
+require 'bundler'
+
+Bundler.require(:rake)
+
+def gemspec
+ @gemspec ||= begin
+ file = File.expand_path('../gem_template.gemspec', __FILE__)
+ eval(File.read(file), binding, file)
+ end
+end
if defined?(ActiveWrapper::Tasks)
ActiveWrapper::Tasks.new(
:base => File.dirname(__FILE__),
:env => ENV['ENV']
)
+end
+
+if defined?(Rake::GemPackageTask)
+ Rake::GemPackageTask.new(gemspec) do |pkg|
+ pkg.gem_spec = gemspec
+ end
+ task :gem => :gemspec
+end
+
+if defined?(Spec::Rake::SpecTask)
+ desc "Run specs"
+ Spec::Rake::SpecTask.new do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts = %w(-fs --color)
+ t.warning = true
+ end
+ task :spec
+end
+
+desc "Install gem locally"
+task :install => :package do
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
+end
+
+desc "Validate the gemspec"
+task :gemspec do
+ gemspec.validate
+end
+
+task :package => :gemspec
+task :default => :spec
+
+# DELETE AFTER USING
+desc "Rename project"
+task :rename do
+ name = ENV['NAME'] || File.basename(Dir.pwd)
+ camelize = lambda do |str|
+ str.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
+ end
+ begin
+ dir = Dir['**/gem_template*']
+ from = dir.pop
+ if from
+ to = from.split('/')
+ to[-1].gsub!('gem_template', name)
+ FileUtils.mv(from, to.join('/'))
+ end
+ end while dir.length > 0
+ Dir["**/*"].each do |path|
+ next if path.include?('Rakefile')
+ if File.file?(path)
+ `sed -i '' 's/gem_template/#{name}/g' #{path}`
+ `sed -i '' 's/GemTemplate/#{camelize.call(name)}/g' #{path}`
+ no_space = File.read(path).gsub(/\s+\z/, '')
+ File.open(path, 'w') { |f| f.write(no_space) }
+ end
+ end
end
View
@@ -0,0 +1,30 @@
+# -*- encoding: utf-8 -*-
+lib = File.expand_path('../lib/', __FILE__)
+$:.unshift lib unless $:.include?(lib)
+
+require 'a_b/version'
+require 'rubygems'
+require 'bundler'
+
+Gem::Specification.new do |s|
+ s.name = "a_b"
+ s.version = AB::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Winton Welsh"]
+ s.email = ["mail@wintoni.us"]
+ s.homepage = "http://github.com/winton/a_b"
+ s.summary = ""
+ s.description = ""
+
+ Bundler.definition.dependencies.each do |dep|
+ if dep.groups.include?(:gemspec)
+ s.add_dependency dep.name, dep.requirement
+ elsif dep.groups.include?(:gemspec_dev)
+ s.add_development_dependency dep.name, dep.requirement
+ end
+ end
+
+ s.files = Dir.glob("{bin,lib}/**/*") + %w(LICENSE README.md)
+ s.executables = Dir.glob("{bin}/*").collect { |f| File.basename(f) }
+ s.require_path = 'lib'
+end
View
@@ -1,3 +1,3 @@
require "#{::File.dirname(__FILE__)}/lib/a_b"
-run Application
+run Application
@@ -3,4 +3,4 @@ development:
database: a_b
username: root
password:
- host: localhost
+ host: localhost
View
@@ -13,4 +13,4 @@ production:
password: password
port: 587
enable_starttls_auto: true
- user_name: test@mydomain.com
+ user_name: test@mydomain.com
View
@@ -15,4 +15,4 @@ def self.up
def self.down
drop_table :tests
end
-end
+end
@@ -19,4 +19,4 @@ def self.up
def self.down
drop_table :variants
end
-end
+end
@@ -16,4 +16,4 @@ def self.up
def self.down
drop_table :requests
end
-end
+end
View
@@ -10,4 +10,4 @@ def self.up
def self.down
drop_table :users
end
-end
+end
View
@@ -11,4 +11,4 @@ def self.up
def self.down
drop_table :ips
end
-end
+end
@@ -11,4 +11,4 @@ def self.up
def self.down
drop_table :categories
end
-end
+end
View
@@ -11,4 +11,4 @@ def self.up
def self.down
drop_table :envs
end
-end
+end
View
@@ -9,4 +9,4 @@ def self.up
def self.down
drop_table :sites
end
-end
+end
@@ -9,4 +9,4 @@ def self.up
def self.down
drop_table :collaborations
end
-end
+end
Oops, something went wrong.

0 comments on commit 07b904f

Please sign in to comment.