nozomi 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/*.log
4
+ tmp/**/*
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Josh Price
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,67 @@
1
+ Nozomi: Faster Rails templating
2
+ ===============================
3
+
4
+ My stack for new rails 3 projects.
5
+
6
+ Each change is committed to git in a single commit, so you can cherry pick the bits you like. Alternatively feel free to use the template as a base for your own version.
7
+
8
+
9
+
10
+ rspec
11
+ -----
12
+
13
+ I don't remember the last time I used Test::Unit, does anybody actually use it anymore?
14
+
15
+ rspec-integration
16
+ -----------------
17
+
18
+ Because cucumber is pretty heavyweight and somewhat awkward compared to plain old rspec, (admit it non-devs rarely read or write your stories anyway)
19
+
20
+ capybara
21
+ --------
22
+
23
+ The best interface for driving any kind of integration specs with Selenium, Webrat, etc
24
+
25
+ haml
26
+ ----
27
+
28
+ I cringe when I see ERB, if your designer doesn't understand Haml, perhaps it's time for a new designer
29
+
30
+ sass
31
+ ----
32
+
33
+ Now that SCSS is a superset of CSS there should be no arguments here
34
+
35
+ compass
36
+ -------
37
+
38
+ Useful for its library of CSS3 mixins and other useful utility functions
39
+
40
+ grid-coordinates
41
+ ----------------
42
+
43
+ Because blueprint and other compass css frameworks are too heavyweight
44
+
45
+ decent_exposure
46
+ ---------------
47
+
48
+ For fashion-model thin controllers, so skinny they're barely there. (Nozomi is also a Japanese fashion model)|
49
+
50
+
51
+
52
+ How to contribute
53
+ -----------------
54
+
55
+ * Fork the project.
56
+ * Make your feature addition or bug fix.
57
+ * Add tests for it. This is important so I don't break it in a
58
+ future version unintentionally.
59
+ * Commit, do not mess with rakefile, version, or history.
60
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
61
+ * Send me a pull request. Bonus points for topic branches.
62
+
63
+ Copyright
64
+ ---------
65
+
66
+ Copyright (c) 2010 Josh Price. See LICENSE for details.
67
+
@@ -0,0 +1,39 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "nozomi"
8
+ gem.summary = %Q{Get your rails projects going faster with Nozomi}
9
+ gem.description = %Q{Opinionated Rails project templating: rspec, capybara, haml, sass, compass, etc}
10
+ gem.email = "joshcp@gmail.com"
11
+ gem.homepage = "http://github.com/joshprice/nozomi"
12
+ gem.authors = ["Josh Price"]
13
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
+ end
15
+ Jeweler::GemcutterTasks.new
16
+ rescue LoadError
17
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
18
+ end
19
+
20
+ require 'rake/testtask'
21
+ Rake::TestTask.new(:test) do |test|
22
+ test.libs << 'lib' << 'test'
23
+ test.pattern = 'test/**/test_*.rb'
24
+ test.verbose = true
25
+ end
26
+
27
+ task :test => :check_dependencies
28
+
29
+ task :default => :test
30
+
31
+ require 'rake/rdoctask'
32
+ Rake::RDocTask.new do |rdoc|
33
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
34
+
35
+ rdoc.rdoc_dir = 'rdoc'
36
+ rdoc.title = "nozomi #{version}"
37
+ rdoc.rdoc_files.include('README*')
38
+ rdoc.rdoc_files.include('lib/**/*.rb')
39
+ end
data/TODO ADDED
@@ -0,0 +1,5 @@
1
+ TODO list
2
+
3
+ [ ] build up gemfile piece by piece based on choices
4
+ [ ] choose persistence (postgresql, mysql, mongodb or just stick with rails)
5
+ [ ] choose deployment (or just go with capistrano by default)
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # TODO use thor or trollop to get the command line options
4
+
5
+ begin
6
+ project_name = ARGV[0]
7
+ raise unless project_name
8
+ template_path = "lib/rails3-template.rb"
9
+
10
+ cmd = "rails new #{project_name} -m #{template_path} --skip-gemfile --skip-test-unit --skip-prototype"
11
+ puts cmd
12
+ system cmd
13
+ rescue
14
+ puts "Usage: nozomi <app_name>"
15
+ end
@@ -0,0 +1,103 @@
1
+ # Nozomi: An opinionated Rails template
2
+ #
3
+ # Assumes you skipped the Gemfile, test/unit and prototype JS which is done through options like this:
4
+ #
5
+ # rails new myapp -m rails3-template.rb --skip-gemfile --skip-test-unit --skip-prototype
6
+ #
7
+ # Written on a nozomi shinkansen so you know it's awesome
8
+
9
+
10
+ GEMS = %w(haml compass formtastic decent_exposure capistrano)
11
+ TEST_GEMS = %w(rspec rspec-rails capybara webrat)
12
+
13
+ def gem_def(gem_name)
14
+ "gem '#{gem_name}'"
15
+ end
16
+
17
+ def git_commit(message, &block)
18
+ yield if block
19
+ git :add => '.'
20
+ git :commit => "-m'Nozomi: #{message}'"
21
+ end
22
+
23
+ # init the repo and commit the rails generated files to git
24
+ def initial_git_commit(message)
25
+ git :init
26
+ git_commit message
27
+ end
28
+
29
+ def copy_db_yml
30
+ run 'cp config/database.yml config/database.example.yml'
31
+ end
32
+
33
+ def remove_public_files
34
+ %w{index.html favicon.ico}.each do |f|
35
+ run "rm public/#{f}"
36
+ end
37
+ end
38
+
39
+ def add_readme
40
+ run "rm README"
41
+ file "README.markdown", <<-MARKDOWN
42
+ README
43
+ ======
44
+
45
+ TODO fill out your application documentation
46
+ MARKDOWN
47
+ end
48
+
49
+ def install_jquery
50
+ filename = "jquery-1.4.2.min.js"
51
+ url = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
52
+ run 'mkdir -p public/javascripts/vendor'
53
+ inside('public/javascripts/vendor') do
54
+ result = run "wget --output-document=#{filename} #{url}"
55
+ raise "Cannot download jquery. Please check your internet connection..." unless result == 0
56
+ end
57
+ end
58
+
59
+ def add_gemfile
60
+ file "Gemfile", <<-RUBY
61
+ # TODO shouldn't this be gemcutter?
62
+ source 'http://rubygems.org'
63
+
64
+ gem 'rails', '3.0.0'
65
+
66
+ #{GEMS.map{ |gem| gem_def(gem) }.join("\n")}
67
+
68
+ # persistence
69
+ gem 'sqlite3-ruby', :require => 'sqlite3'
70
+
71
+ group :development, :test do
72
+ #{TEST_GEMS.map{ |gem| gem_def(gem) }.join("\n ")}
73
+
74
+ gem 'ruby-debug'
75
+ gem 'awesome_print', :require => 'ap'
76
+ gem 'wirble'
77
+ gem 'hirb'
78
+ end
79
+ RUBY
80
+ end
81
+
82
+ # generate 'rspec'
83
+ # run "haml --rails #{run "pwd"}"
84
+
85
+ begin
86
+ initial_git_commit "Initial commit from rails"
87
+ git_commit("Remove public files") { remove_public_files }
88
+ git_commit("Readme") { add_readme }
89
+ git_commit("Copy database.yml") { copy_db_yml }
90
+ #git_commit("Install jQuery") { install_jquery }
91
+ git_commit("Bundler gemfile") { add_gemfile }
92
+
93
+ puts <<-MSG
94
+ Nozomi Rails template complete! Your next steps are:
95
+
96
+ 1. Edit config/database.yml to match your database config
97
+ 2. rake db:create:all (to create all databases)
98
+ 3. rake db:migrate (to create a db/schema.rb)
99
+ 4. Start building your app!
100
+ MSG
101
+ rescue Exception => e
102
+ puts "\n#{e.message}"
103
+ end
@@ -0,0 +1,49 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{nozomi}
8
+ s.version = "0.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Josh Price"]
12
+ s.date = %q{2010-09-15}
13
+ s.default_executable = %q{nozomi}
14
+ s.description = %q{Opinionated Rails project templating: rspec, capybara, haml, sass, compass, etc}
15
+ s.email = %q{joshcp@gmail.com}
16
+ s.executables = ["nozomi"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.markdown",
20
+ "TODO"
21
+ ]
22
+ s.files = [
23
+ ".gitignore",
24
+ "LICENSE",
25
+ "README.markdown",
26
+ "Rakefile",
27
+ "TODO",
28
+ "VERSION",
29
+ "bin/nozomi",
30
+ "lib/rails3-template.rb",
31
+ "nozomi.gemspec"
32
+ ]
33
+ s.homepage = %q{http://github.com/joshprice/nozomi}
34
+ s.rdoc_options = ["--charset=UTF-8"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.3.7}
37
+ s.summary = %q{Get your rails projects going faster with Nozomi}
38
+
39
+ if s.respond_to? :specification_version then
40
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
41
+ s.specification_version = 3
42
+
43
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
44
+ else
45
+ end
46
+ else
47
+ end
48
+ end
49
+
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nozomi
3
+ version: !ruby/object:Gem::Version
4
+ hash: 31
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 0
10
+ version: 0.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Josh Price
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-09-15 00:00:00 +10:00
19
+ default_executable: nozomi
20
+ dependencies: []
21
+
22
+ description: "Opinionated Rails project templating: rspec, capybara, haml, sass, compass, etc"
23
+ email: joshcp@gmail.com
24
+ executables:
25
+ - nozomi
26
+ extensions: []
27
+
28
+ extra_rdoc_files:
29
+ - LICENSE
30
+ - README.markdown
31
+ - TODO
32
+ files:
33
+ - .gitignore
34
+ - LICENSE
35
+ - README.markdown
36
+ - Rakefile
37
+ - TODO
38
+ - VERSION
39
+ - bin/nozomi
40
+ - lib/rails3-template.rb
41
+ - nozomi.gemspec
42
+ has_rdoc: true
43
+ homepage: http://github.com/joshprice/nozomi
44
+ licenses: []
45
+
46
+ post_install_message:
47
+ rdoc_options:
48
+ - --charset=UTF-8
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
68
+ version: "0"
69
+ requirements: []
70
+
71
+ rubyforge_project:
72
+ rubygems_version: 1.3.7
73
+ signing_key:
74
+ specification_version: 3
75
+ summary: Get your rails projects going faster with Nozomi
76
+ test_files: []
77
+