simba 0.0.5 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +2 -2
  3. data/README.md +17 -5
  4. data/bin/simba +1 -2
  5. data/lib/simba.rb +2 -39
  6. data/lib/simba/command.rb +24 -0
  7. data/lib/simba/templates/Gemfile +28 -0
  8. data/lib/simba/templates/Linnerfile +37 -0
  9. data/lib/simba/templates/Rakefile +6 -0
  10. data/lib/simba/templates/app/assets/images/logo.png +0 -0
  11. data/lib/simba/templates/app/assets/scripts/app.coffee +4 -0
  12. data/lib/simba/templates/app/assets/scripts/welcome.coffee +2 -0
  13. data/lib/simba/templates/app/assets/styles/app.scss +9 -0
  14. data/lib/simba/templates/app/helpers/helper.rb +9 -0
  15. data/lib/simba/templates/app/models/user.rb +2 -0
  16. data/lib/simba/templates/app/routes/app.rb +3 -0
  17. data/lib/simba/templates/app/views/home/index.slim +3 -0
  18. data/lib/simba/templates/app/views/layout.slim +10 -0
  19. data/lib/simba/templates/config.ru +7 -0
  20. data/lib/simba/templates/config/boot.rb.tt +28 -0
  21. data/lib/simba/templates/config/database.yml +17 -0
  22. data/lib/simba/templates/lib/tasks/assets.rake +6 -0
  23. data/lib/simba/{base_app → templates}/test/factory/user_factory.rb +0 -0
  24. data/lib/simba/{base_app → templates}/test/functional/user_controller_test.rb +0 -0
  25. data/lib/simba/{base_app → templates}/test/test_helper.rb +1 -1
  26. data/lib/simba/{base_app → templates}/test/unit/user_test.rb +0 -0
  27. data/lib/simba/version.rb +1 -1
  28. data/simba.gemspec +2 -2
  29. data/{lib/simba/base_app → template}/.gitignore +1 -0
  30. data/template/Gemfile +25 -0
  31. data/template/Rakefile +3 -0
  32. data/{lib/simba/base_app → template}/app/assets/css/application.scss +0 -0
  33. data/{lib/simba/base_app → template}/app/assets/img/.gitkeep +0 -0
  34. data/{lib/simba/base_app → template}/app/assets/js/application.coffee +0 -0
  35. data/template/app/controllers/application_controller.rb +3 -0
  36. data/template/app/helpers/application_helper.rb +14 -0
  37. data/{lib/simba/base_app → template}/app/models/user.rb +0 -0
  38. data/{lib/simba/base_app → template}/app/views/home/index.slim.tt +0 -0
  39. data/{lib/simba/base_app → template}/app/views/layout.slim.tt +0 -0
  40. data/{lib/simba/base_app → template}/config.ru +0 -0
  41. data/{lib/simba/base_app → template}/config/boot.rb.tt +0 -13
  42. data/template/config/database.yml +2 -0
  43. data/{lib/simba/base_app → template}/lib/tasks/stat.rake +3 -3
  44. data/{lib/simba/base_app → template}/lib/tasks/test.rake +0 -0
  45. data/template/test/factory/user_factory.rb +6 -0
  46. data/template/test/functional/user_controller_test.rb +4 -0
  47. data/template/test/test_helper.rb +27 -0
  48. data/template/test/unit/user_test.rb +11 -0
  49. metadata +57 -38
  50. data/lib/simba/base_app/Gemfile +0 -30
  51. data/lib/simba/base_app/Rakefile +0 -7
  52. data/lib/simba/base_app/app/controllers/application_controller.rb +0 -3
  53. data/lib/simba/base_app/app/helpers/application_helper.rb +0 -3
  54. data/lib/simba/base_app/config/database.yml +0 -2
  55. data/lib/simba/base_app/db/migrations/1_create_users.rb +0 -8
  56. data/lib/simba/base_app/lib/tasks/db.rake +0 -40
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cb2bd16368abd55458bba86541741021ef3928a2
4
+ data.tar.gz: 522d9fe673b0aac572284216cad8ceabb105bf28
5
+ SHA512:
6
+ metadata.gz: f789b0e3c3a4682972ba7887cd49c2df8bafb5bf7ac76873da57ee473be4bf98b88a728ac6f7b98a63cde6485ec668ed72f6ebeb44e16066afe47054502f3f8a
7
+ data.tar.gz: 6fe21a4558b682ba7382be5a1fe6f5c31d5958b25164a5663bea04673e56a766927fb70837cb48fd8268f63f0fc3975bf7640c651ce9b0229058f8ba42577c87
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in simba.gemspec
3
+ # Specify your gem"s dependencies in simba.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Simba
2
2
 
3
- simba is a generator for sinatra applications.
3
+ Simba is a generator for Sinatra applications.
4
4
 
5
- simba choose slim + sinatra + sequel to build your awesome app.
5
+ Simba chooses slim + sinatra + activerecord to build your awesome apps.
6
6
 
7
- simba aim to set up ruby off rails's best practice.
7
+ Simba's aim is to help you to use best practices when not using ruby on rails.
8
8
 
9
9
  ## Installation
10
10
 
@@ -12,12 +12,24 @@ simba aim to set up ruby off rails's best practice.
12
12
 
13
13
  ## Usage
14
14
 
15
- $ simba appname [--skip-bundle]
15
+ $ simba new appname
16
+
17
+ $ # development
18
+ $ bundle exec rackup
19
+
20
+ $ # production
21
+ $ rake asset:precompile
22
+ $ bundle exec rackup -E production
23
+
24
+ ## More
25
+
26
+ Simba uses [Linner](https://github.com/SaitoWu/linner) as its asset packaging system,
27
+ You can star it on the github page.
16
28
 
17
29
  ## Contributing
18
30
 
19
31
  1. Fork it
20
32
  2. Create your feature branch (`git checkout -b my-new-feature`)
21
- 3. Commit your changes (`git commit -am 'Added some feature'`)
33
+ 3. Commit your changes (`git commit -am "Added some feature"`)
22
34
  4. Push to the branch (`git push origin my-new-feature`)
23
35
  5. Create new Pull Request
data/bin/simba CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require File.dirname(__FILE__) + "/../lib/simba"
4
- arguments = ARGV.any? ? ARGV : ['-h']
5
- Simba::SkeletonGenerator.start(arguments)
4
+ Simba::Command.start
@@ -1,42 +1,5 @@
1
- require "thor"
2
- require "thor/group"
3
- require "securerandom"
4
- require_relative "simba/version"
1
+ require "simba/command"
2
+ require "simba/version"
5
3
 
6
4
  module Simba
7
- class SkeletonGenerator < Thor::Group
8
- include Thor::Actions
9
-
10
- def self.source_root
11
- File.dirname(__FILE__)
12
- end
13
-
14
- def self.banner
15
- "simba [app_name]"
16
- end
17
-
18
- desc "Description:\n\n\tsimba is a generator for sinatra applications."
19
-
20
- argument :name, :desc => "The name of your sinatra app"
21
- class_option :skip_bundle,
22
- :default => false,
23
- :type => :boolean,
24
- :desc => "Skip bundle install when creating app skeleton"
25
-
26
- def setup_skeleton
27
- self.destination_root = name
28
- @class_name = name
29
- @session_secret = SecureRandom.hex 16
30
- directory("simba/base_app/", self.destination_root)
31
- end
32
-
33
- def bundle_dependencies
34
- unless options[:skip_bundle]
35
- say "Bundling application dependencies using bundler."
36
- in_root do
37
- run 'bundle install'
38
- end
39
- end
40
- end
41
- end
42
5
  end
@@ -0,0 +1,24 @@
1
+ require "thor"
2
+ require "securerandom"
3
+
4
+ module Simba
5
+ class Command < Thor
6
+ include Thor::Actions
7
+ map "-v" => :version
8
+
9
+ def self.source_root
10
+ File.dirname(__FILE__)
11
+ end
12
+
13
+ desc "version", "show version"
14
+ def version
15
+ puts Simba::VERSION
16
+ end
17
+
18
+ desc "new", "create the skeleton of project"
19
+ def new(name)
20
+ @secret = SecureRandom.hex 32
21
+ directory("templates", name)
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,28 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rake"
4
+ gem "sqlite3"
5
+ gem "slim", "~> 2.0.1"
6
+ gem "sinatra", "~> 1.4.3"
7
+ gem "sinatra-contrib", "~> 1.4.1"
8
+ gem "sinatra-activerecord", "~> 1.2.3"
9
+
10
+ # If you want to use mail
11
+ # gem "pony"
12
+
13
+ group :development do
14
+ gem "http", "~> 0.5.0"
15
+ gem "therubyracer", "~> 0.12.0"
16
+ gem "linner", "~> 0.6", require: false
17
+ end
18
+
19
+ group :production do
20
+ gem "puma"
21
+ end
22
+
23
+ group :test do
24
+ gem "pry"
25
+ gem "rack-test"
26
+ gem "factory_girl"
27
+ gem "database_cleaner"
28
+ end
@@ -0,0 +1,37 @@
1
+ paths:
2
+ app: "app/assets"
3
+ public: "public"
4
+ groups:
5
+ scripts:
6
+ paths:
7
+ - app/assets/scripts
8
+ concat:
9
+ "/assets/app.js": "{app/assets/scripts,vendor}/**/*.{js,coffee}"
10
+ order:
11
+ - "vendor/jquery.js"
12
+ - "..."
13
+ - "app/scripts/app.coffee"
14
+ styles:
15
+ paths:
16
+ - app/assets/styles
17
+ concat:
18
+ "/assets/app.css": "{app/assets/styles,vendor}/**/[a-z]*.{css,scss,sass}"
19
+ images:
20
+ paths:
21
+ - app/assets/images
22
+ sprite:
23
+ "../app/assets/styles/icons.scss": "app/assets/images/**/*.png"
24
+ modules:
25
+ wrapper: "cmd"
26
+ ignored: "vendor/**/*"
27
+ definition: "/assets/app.js"
28
+ sprites:
29
+ selector: ".icon-"
30
+ path: "/assets/images/"
31
+ url: "/assets/images/"
32
+ revision: true
33
+ notification: true
34
+ bundles:
35
+ jquery.js:
36
+ version: 1.11.0
37
+ url: http://code.jquery.com/jquery-1.11.0.js
@@ -0,0 +1,6 @@
1
+ # load rake tasks
2
+ require "sinatra/activerecord/rake"
3
+
4
+ Dir["./lib/tasks/**/*.rake"].sort.each { |ext| load ext }
5
+
6
+ require "./config/boot.rb"
@@ -0,0 +1,4 @@
1
+ welcome = require "welcome"
2
+
3
+ $ ->
4
+ welcome()
@@ -0,0 +1,2 @@
1
+ module.exports = ->
2
+ console.info "Aha! Simba!"
@@ -0,0 +1,9 @@
1
+ @import "compass/reset";
2
+
3
+ .hero-unit {
4
+ text-align: center;
5
+
6
+ .icon-logo {
7
+ margin: 0 auto;
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ helpers do
2
+ def asset_path file
3
+ if settings.development?
4
+ file
5
+ else
6
+ settings.manifest[file]
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,2 @@
1
+ class User < ActiveRecord::Base
2
+ end
@@ -0,0 +1,3 @@
1
+ get "/" do
2
+ slim :"home/index"
3
+ end
@@ -0,0 +1,3 @@
1
+ .hero-unit
2
+ .icon-logo
3
+ h3 Welcome to Simba!
@@ -0,0 +1,10 @@
1
+ doctype html
2
+ html
3
+ head
4
+ title Simba
5
+ meta name="keywords" content="website"
6
+ link rel="stylesheet" href=asset_path("/assets/app.css")
7
+ body
8
+ == yield
9
+ script src=asset_path("/assets/app.js")
10
+ script =="require(\"app\")"
@@ -0,0 +1,7 @@
1
+ require "./config/boot.rb"
2
+
3
+ Process.fork do
4
+ exec "bundle exec linner watch"
5
+ end if settings.development?
6
+
7
+ run Sinatra::Application
@@ -0,0 +1,28 @@
1
+ require "bundler"
2
+ require "yaml"
3
+
4
+ # require "bundle gems"
5
+ ENV["RACK_ENV"] ||= "development"
6
+ Bundler.require(:default, ENV["RACK_ENV"].to_sym)
7
+
8
+ # init sinatra
9
+ set :root, File.expand_path(".")
10
+ set :sessions, true
11
+ set :session_secret, "<%= @secret %>"
12
+ set :views, settings.root + "/app/views"
13
+ set :database_file, settings.root + "/config/database.yml"
14
+
15
+ if production?
16
+ set :manifest, YAML::load(File.read(settings.root + "/public/manifest.yml"))
17
+ end
18
+
19
+ # sinatra reloader
20
+ if development?
21
+ require "sinatra/reloader"
22
+ also_reload "lib/**/*.rb", "app/{models,helpers}/**/*.rb"
23
+ end
24
+
25
+ # require project files
26
+ Dir.glob "./{lib,app/{models,helpers,routes}}/**/*.rb" do |f|
27
+ require f
28
+ end
@@ -0,0 +1,17 @@
1
+ development:
2
+ adapter: sqlite3
3
+ database: db/development.sqlite3
4
+ pool: 5
5
+ timeout: 5000
6
+
7
+ test:
8
+ adapter: sqlite3
9
+ database: db/test.sqlite3
10
+ pool: 5
11
+ timeout: 5000
12
+
13
+ production:
14
+ adapter: sqlite3
15
+ database: db/production.sqlite3
16
+ pool: 5
17
+ timeout: 5000
@@ -0,0 +1,6 @@
1
+ namespace :assets do
2
+ desc "precompile assets"
3
+ task :precompile do
4
+ exec "bundle exec linner build"
5
+ end
6
+ end
@@ -1,4 +1,4 @@
1
- ENV['RACK_ENV'] ||= "test"
1
+ ENV["RACK_ENV"] ||= "test"
2
2
  require_relative "../config/boot.rb"
3
3
 
4
4
  # factory_girl
@@ -1,3 +1,3 @@
1
1
  module Simba
2
- VERSION = "0.0.5"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/simba/version', __FILE__)
2
+ require File.expand_path("../lib/simba/version", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Saito"]
@@ -15,5 +15,5 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Simba::VERSION
17
17
 
18
- gem.add_dependency("thor", "~> 0.14.6")
18
+ gem.add_dependency("thor", "~> 0.18")
19
19
  end
@@ -3,3 +3,4 @@
3
3
  *.db
4
4
  public/*.*
5
5
  coverage/
6
+ .bundle
@@ -0,0 +1,25 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "sqlite3"
4
+ gem "slim", "~> 2.0.1"
5
+ gem "sinatra", "~> 1.4.3"
6
+ gem "sinatra-contrib", "~> 1.4.1"
7
+ gem "sinatra-activerecord", "~> 1.2.3"
8
+
9
+ # If you want to use mail
10
+ # gem "pony"
11
+
12
+ group :development do
13
+ gem "linner", "~> 0.4"
14
+ end
15
+
16
+ group :production do
17
+ gem "puma"
18
+ end
19
+
20
+ group :test do
21
+ gem "pry"
22
+ gem "rack-test"
23
+ gem "factory_girl"
24
+ gem "database_cleaner"
25
+ end
@@ -0,0 +1,3 @@
1
+ # load rake tasks
2
+ require "sinatra/activerecord/rake"
3
+ Dir["./lib/tasks/**/*.rake"].sort.each { |ext| load ext }
@@ -0,0 +1,3 @@
1
+ get "/" do
2
+ slim :"home/index"
3
+ end
@@ -0,0 +1,14 @@
1
+ helpers do
2
+ include Sprockets::Helpers
3
+
4
+ def js file
5
+ file = "js/#{file}.js"
6
+ %Q|<script src="#{asset_path file}"></script>|
7
+ end
8
+
9
+ def css file
10
+ file = "css/#{file}.css"
11
+ %Q|<link rel="stylesheet" href="#{asset_path file}"/>|
12
+ end
13
+
14
+ end
@@ -21,19 +21,6 @@ if development?
21
21
  also_reload "lib/**/*.rb", "app/{models,helpers}/**/*.rb"
22
22
  end
23
23
 
24
- # assetpack support
25
- assets do
26
- serve "/js", :from => "app/assets/js"
27
- serve "/css", :from => "app/assets/css"
28
- serve "/img", :from => "app/assets/img"
29
-
30
- css_compression :sass
31
- js_compression :uglify
32
-
33
- js :application, ["/js/*.js"]
34
- css :application, ["/css/*.css"]
35
- end
36
-
37
24
  # require project files
38
25
  Dir.glob "./{lib,app/models,app/helpers,app/controllers}/**/*.rb" do |f|
39
26
  require f
@@ -0,0 +1,2 @@
1
+ default:
2
+ url: sqlite://db/development.db # postgres://user:password@host:port/database_name
@@ -1,11 +1,11 @@
1
1
  namespace :metric do
2
2
 
3
3
  desc "project statistics"
4
- task 'stat' do
4
+ task "stat" do
5
5
  puts "All:"
6
- stat_files Dir.glob('**/*.{rb,slim,coffee,scss}')
6
+ stat_files Dir.glob("**/*.{rb,slim,coffee,scss}")
7
7
  puts "\nRuby:"
8
- stat_files Dir.glob('**/*.rb') - Dir.glob('test/**/*.rb')
8
+ stat_files Dir.glob("**/*.rb") - Dir.glob("test/**/*.rb")
9
9
  end
10
10
  end
11
11
 
@@ -0,0 +1,6 @@
1
+ # https://github.com/thoughtbot/factory_girl/wiki/Usage
2
+ FactoryGirl.define do
3
+ factory :user do
4
+ name "simba"
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ require_relative "../test_helper"
2
+
3
+ class UserControllerTest < FunctionalTestCase
4
+ end
@@ -0,0 +1,27 @@
1
+ ENV["RACK_ENV"] ||= "test"
2
+ require_relative "../config/boot.rb"
3
+
4
+ # factory_girl
5
+ dir = File.expand_path File.dirname(__FILE__)
6
+ Dir.glob "#{dir}/factory/**/*_factory.rb" do |f|
7
+ require f
8
+ end
9
+
10
+ require "minitest/autorun"
11
+ require "rack/test"
12
+ DatabaseCleaner.strategy = :truncation
13
+
14
+ class TestCase < MiniTest::Unit::TestCase
15
+ include FactoryGirl::Syntax::Methods
16
+ def initialize *xs
17
+ super
18
+ DatabaseCleaner.clean
19
+ end
20
+ end
21
+
22
+ class FunctionalTestCase < TestCase
23
+ include Rack::Test::Methods
24
+ def app
25
+ Sinatra::Application
26
+ end
27
+ end
@@ -0,0 +1,11 @@
1
+ require_relative "../test_helper"
2
+
3
+ class UserTest < TestCase
4
+ def setup
5
+ @user = build :user
6
+ end
7
+
8
+ def test_user_name
9
+ # dummy
10
+ end
11
+ end
metadata CHANGED
@@ -1,27 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease:
4
+ version: 0.8.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Saito
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-04-29 00:00:00.000000000 Z
11
+ date: 2014-04-07 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: thor
16
- requirement: &70204877263740 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: 0.14.6
19
+ version: '0.18'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *70204877263740
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.18'
25
27
  description: simba is a generator for sinatra applications.
26
28
  email:
27
29
  - saitowu@gmail.com
@@ -30,60 +32,77 @@ executables:
30
32
  extensions: []
31
33
  extra_rdoc_files: []
32
34
  files:
33
- - .gitignore
35
+ - ".gitignore"
34
36
  - Gemfile
35
37
  - LICENSE
36
38
  - README.md
37
39
  - Rakefile
38
40
  - bin/simba
39
41
  - lib/simba.rb
40
- - lib/simba/base_app/.gitignore
41
- - lib/simba/base_app/Gemfile
42
- - lib/simba/base_app/Rakefile
43
- - lib/simba/base_app/app/assets/css/application.scss
44
- - lib/simba/base_app/app/assets/img/.gitkeep
45
- - lib/simba/base_app/app/assets/js/application.coffee
46
- - lib/simba/base_app/app/controllers/application_controller.rb
47
- - lib/simba/base_app/app/helpers/application_helper.rb
48
- - lib/simba/base_app/app/models/user.rb
49
- - lib/simba/base_app/app/views/home/index.slim.tt
50
- - lib/simba/base_app/app/views/layout.slim.tt
51
- - lib/simba/base_app/config.ru
52
- - lib/simba/base_app/config/boot.rb.tt
53
- - lib/simba/base_app/config/database.yml
54
- - lib/simba/base_app/db/migrations/1_create_users.rb
55
- - lib/simba/base_app/lib/tasks/db.rake
56
- - lib/simba/base_app/lib/tasks/stat.rake
57
- - lib/simba/base_app/lib/tasks/test.rake
58
- - lib/simba/base_app/test/factory/user_factory.rb
59
- - lib/simba/base_app/test/functional/user_controller_test.rb
60
- - lib/simba/base_app/test/test_helper.rb
61
- - lib/simba/base_app/test/unit/user_test.rb
42
+ - lib/simba/command.rb
43
+ - lib/simba/templates/Gemfile
44
+ - lib/simba/templates/Linnerfile
45
+ - lib/simba/templates/Rakefile
46
+ - lib/simba/templates/app/assets/images/logo.png
47
+ - lib/simba/templates/app/assets/scripts/app.coffee
48
+ - lib/simba/templates/app/assets/scripts/welcome.coffee
49
+ - lib/simba/templates/app/assets/styles/app.scss
50
+ - lib/simba/templates/app/helpers/helper.rb
51
+ - lib/simba/templates/app/models/user.rb
52
+ - lib/simba/templates/app/routes/app.rb
53
+ - lib/simba/templates/app/views/home/index.slim
54
+ - lib/simba/templates/app/views/layout.slim
55
+ - lib/simba/templates/config.ru
56
+ - lib/simba/templates/config/boot.rb.tt
57
+ - lib/simba/templates/config/database.yml
58
+ - lib/simba/templates/lib/tasks/assets.rake
59
+ - lib/simba/templates/test/factory/user_factory.rb
60
+ - lib/simba/templates/test/functional/user_controller_test.rb
61
+ - lib/simba/templates/test/test_helper.rb
62
+ - lib/simba/templates/test/unit/user_test.rb
62
63
  - lib/simba/version.rb
63
64
  - simba.gemspec
65
+ - template/.gitignore
66
+ - template/Gemfile
67
+ - template/Rakefile
68
+ - template/app/assets/css/application.scss
69
+ - template/app/assets/img/.gitkeep
70
+ - template/app/assets/js/application.coffee
71
+ - template/app/controllers/application_controller.rb
72
+ - template/app/helpers/application_helper.rb
73
+ - template/app/models/user.rb
74
+ - template/app/views/home/index.slim.tt
75
+ - template/app/views/layout.slim.tt
76
+ - template/config.ru
77
+ - template/config/boot.rb.tt
78
+ - template/config/database.yml
79
+ - template/lib/tasks/stat.rake
80
+ - template/lib/tasks/test.rake
81
+ - template/test/factory/user_factory.rb
82
+ - template/test/functional/user_controller_test.rb
83
+ - template/test/test_helper.rb
84
+ - template/test/unit/user_test.rb
64
85
  homepage: https://github.com/SaitoWu/simba
65
86
  licenses: []
87
+ metadata: {}
66
88
  post_install_message:
67
89
  rdoc_options: []
68
90
  require_paths:
69
91
  - lib
70
92
  required_ruby_version: !ruby/object:Gem::Requirement
71
- none: false
72
93
  requirements:
73
- - - ! '>='
94
+ - - ">="
74
95
  - !ruby/object:Gem::Version
75
96
  version: '0'
76
97
  required_rubygems_version: !ruby/object:Gem::Requirement
77
- none: false
78
98
  requirements:
79
- - - ! '>='
99
+ - - ">="
80
100
  - !ruby/object:Gem::Version
81
101
  version: '0'
82
102
  requirements: []
83
103
  rubyforge_project:
84
- rubygems_version: 1.8.16
104
+ rubygems_version: 2.2.2
85
105
  signing_key:
86
- specification_version: 3
106
+ specification_version: 4
87
107
  summary: simba aim to set up ruby off rails best practice.
88
108
  test_files: []
89
- has_rdoc:
@@ -1,30 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "slim"
4
- gem "sass"
5
- gem "sqlite3"
6
- gem "sequel"
7
- gem "sinatra"
8
- gem "coffee-script"
9
- gem "sinatra-contrib"
10
- gem "sinatra-flash"
11
- gem "sinatra-assetpack", :require => "sinatra/assetpack"
12
-
13
- group :development, :test do
14
- gem "pry"
15
- end
16
-
17
- group :production do
18
- gem "thin"
19
- end
20
-
21
- group :test do
22
- gem "rack-test"
23
- gem "factory_girl"
24
- gem "database_cleaner"
25
- end
26
-
27
- group :deploy do
28
- gem "uglifier"
29
- gem "capistrano"
30
- end
@@ -1,7 +0,0 @@
1
- # load rake tasks
2
- Dir["./lib/tasks/**/*.rake"].sort.each { |ext| load ext }
3
-
4
- # load assetpacket tasks
5
- APP_FILE = './config/boot.rb'
6
- APP_CLASS = 'Sinatra::Application'
7
- require 'sinatra/assetpack/rake'
@@ -1,3 +0,0 @@
1
- get '/' do
2
- slim :'home/index'
3
- end
@@ -1,3 +0,0 @@
1
- helpers do
2
- #dummy
3
- end
@@ -1,2 +0,0 @@
1
- default:
2
- url: sqlite://db/development.db #postgres://user:password@host:port/database_name
@@ -1,8 +0,0 @@
1
- Sequel.migration do
2
- change do
3
- create_table(:users) do
4
- primary_key :id
5
- String :name, :null=>false
6
- end
7
- end
8
- end
@@ -1,40 +0,0 @@
1
- require "yaml"
2
-
3
- namespace :db do
4
-
5
- database_url = YAML.load_file("./config/database.yml")["default"]["url"]
6
-
7
- desc "Perform migration reset (full erase and migration up)"
8
- task :reset do
9
- puts `sequel -Etm ./db/migrations -M 0 #{database_url}`
10
- puts `sequel -Etm ./db/migrations #{database_url}`
11
- puts "<= rake db:reset executed"
12
- end
13
-
14
- desc "Perform migration up/down to VERSION"
15
- task :version do
16
- version = ENV['VERSION'].to_i
17
- raise "No VERSION was provided" if version.nil?
18
- puts `sequel -Etm db/migrations -M #{version} #{database_url}`
19
- puts "<= rake db:version version=[#{version}] executed"
20
- end
21
-
22
- desc "Perform migration up to latest migration available"
23
- task :migrate do
24
- puts `sequel -Etm ./db/migrations #{database_url}`
25
- puts "<= rake db:migrate executed"
26
- end
27
-
28
- desc "Perform migration down (erase all data)"
29
- task :rollback do
30
- puts `sequel -Etm ./db/migrations -M 0 #{database_url}`
31
- puts "<= rake db:rollback executed"
32
- end
33
-
34
- desc "Perform schema dump (dumping the current schema as a migration)"
35
- task :dump do
36
- raise "No FILENAME was provided" if ENV["FILENAME"].nil?
37
- puts `sequel -Etd #{database_url} > ./db/migrations/#{ENV["FILENAME"]}`
38
- puts "<= rake db:dump executed"
39
- end
40
- end