myway 0.1.4 → 0.1.5
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/lib/myway.rb +16 -2
- data/lib/myway/templates/app/views/includes/navbar.haml.tt +1 -1
- data/lib/myway/templates/app/views/layout.haml.tt +1 -1
- data/lib/myway/templates/gemfile.tt +20 -1
- data/lib/myway/templates/gemspec.tt +5 -0
- data/lib/myway/templates/rakefile.tt +7 -1
- data/lib/myway/templates/spec/acceptance_helper.rb.tt +31 -0
- data/lib/myway/templates/spec/factories.rb.tt +3 -0
- data/lib/myway/templates/spec/fixtures.js.tt +5 -0
- data/lib/myway/templates/spec/specHelper.js.tt +9 -0
- data/lib/myway/templates/spec/spec_helper.rb.tt +27 -0
- data/lib/myway/version.rb +1 -1
- metadata +8 -2
    
        data/lib/myway.rb
    CHANGED
    
    | @@ -6,10 +6,12 @@ require "thor" | |
| 6 6 |  | 
| 7 7 | 
             
            JS_LIBS = {
         | 
| 8 8 | 
             
                'head' => 'https://github.com/headjs/headjs/raw/v0.96/dist/head.load.min.js',
         | 
| 9 | 
            -
                'jquery' => 'http://code.jquery.com/jquery-1. | 
| 9 | 
            +
                'jquery' => 'http://code.jquery.com/jquery-1.8.2.min.js',
         | 
| 10 10 | 
             
                'backbone' => 'http://documentcloud.github.com/backbone/backbone-min.js',
         | 
| 11 11 | 
             
                'underscore' => 'http://documentcloud.github.com/underscore/underscore-min.js',
         | 
| 12 | 
            -
                'bootstrap' => 'http://twitter.github.com/bootstrap/assets/bootstrap.zip'
         | 
| 12 | 
            +
                'bootstrap' => 'http://twitter.github.com/bootstrap/assets/bootstrap.zip',
         | 
| 13 | 
            +
                'kickstart' => 'http://www.99lime.com/downloads/',
         | 
| 14 | 
            +
                'yepnope' => 'https://github.com/SlexAxton/yepnope.js/zipball/master'
         | 
| 13 15 | 
             
            }
         | 
| 14 16 | 
             
            class String
         | 
| 15 17 | 
             
              def camelize(first_letter_in_uppercase = true)
         | 
| @@ -57,6 +59,9 @@ module Myway | |
| 57 59 | 
             
                  template "myway/templates/rakefile.tt", "#{name}/Rakefile"
         | 
| 58 60 | 
             
                  template "myway/templates/readme.tt", "#{name}/README.md"
         | 
| 59 61 | 
             
                  template "myway/templates/gitignore.tt", "#{name}/.gitignore"
         | 
| 62 | 
            +
                  template "myway/templates/gitkeep.tt", "#{name}/app/models/.gittkeep"
         | 
| 63 | 
            +
                  template "myway/templates/spec/spec_helper.rb.tt", "#{name}/spec/spec_helper.rb"
         | 
| 64 | 
            +
                  template "myway/templates/spec/acceptance_helper.rb.tt", "#{name}/spec/acceptance_helper.rb"
         | 
| 60 65 |  | 
| 61 66 | 
             
                  Dir.chdir(File.join(Dir.pwd, name))
         | 
| 62 67 |  | 
| @@ -64,6 +69,7 @@ module Myway | |
| 64 69 |  | 
| 65 70 | 
             
                  init_git
         | 
| 66 71 | 
             
                  init_bundle
         | 
| 72 | 
            +
                  init_jasmine
         | 
| 67 73 | 
             
                  init_capistrano
         | 
| 68 74 |  | 
| 69 75 | 
             
                end
         | 
| @@ -131,6 +137,14 @@ module Myway | |
| 131 137 | 
             
                      when :capistrano
         | 
| 132 138 | 
             
                        say "Initializing capistrano deploy script"
         | 
| 133 139 | 
             
                        template "myway/templates/config/deploy.rb.tt", "#{name}/config/deploy.rb"
         | 
| 140 | 
            +
                      when :jasmine
         | 
| 141 | 
            +
                        say "Initialize Jasmine specs settings in #{name} ..."
         | 
| 142 | 
            +
                        `jasmine init`
         | 
| 143 | 
            +
                        FileUtils.rm_rf "./public/javascripts"
         | 
| 144 | 
            +
                        FileUtils.rm_rf "./spec/javascripts/helpers/*.js"
         | 
| 145 | 
            +
                        FileUtils.rm_rf "./spec/javascripts/*.js"
         | 
| 146 | 
            +
                        template "myway/templates/spec/specHelper.js.tt", "#{name}/spec/javascripts/helpers/specHelper.js"
         | 
| 147 | 
            +
                        template "myway/templates/spec/fixture.js.tt", "#{name}/spec/javascripts/fixtures/fixtures.js"
         | 
| 134 148 | 
             
                    end
         | 
| 135 149 | 
             
                  end
         | 
| 136 150 | 
             
                end
         | 
| @@ -26,7 +26,7 @@ | |
| 26 26 | 
             
                  =yield
         | 
| 27 27 | 
             
                %script
         | 
| 28 28 | 
             
                  head.js(
         | 
| 29 | 
            -
                  /js/underscore.min.js", "/js/backbone.min.js",
         | 
| 29 | 
            +
                  "/js/underscore.min.js", "/js/backbone.min.js",
         | 
| 30 30 | 
             
                  "/js/bootstrap-alert.js", "/js/bootstrap-dropdown.js",
         | 
| 31 31 | 
             
                  "/js/bootstrap-modal.js","/js/bootstrap-tooltip.js"
         | 
| 32 32 | 
             
                  //"/js/bootstrap-button.js","/js/bootstrap-collapse.js","/js/bootstrap-carousel.js",
         | 
| @@ -1,4 +1,23 @@ | |
| 1 1 | 
             
            source 'https://rubygems.org'
         | 
| 2 2 |  | 
| 3 3 | 
             
            # Specify your gem's dependencies in <%= name %>.gemspec
         | 
| 4 | 
            -
            gemspec
         | 
| 4 | 
            +
            # gemspec
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            gem "sinatra"
         | 
| 7 | 
            +
            gem "unicorn"
         | 
| 8 | 
            +
            gem "sprockets"
         | 
| 9 | 
            +
            gem "yui-compressor"
         | 
| 10 | 
            +
            gem "haml"
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            group :test do
         | 
| 13 | 
            +
              gem "rspec"
         | 
| 14 | 
            +
              gem "jasmine"
         | 
| 15 | 
            +
              # gem "jasmine-phantom"
         | 
| 16 | 
            +
              gem "factory-girl"
         | 
| 17 | 
            +
              #gem "capybara"
         | 
| 18 | 
            +
              #gem "poltergeist"
         | 
| 19 | 
            +
            end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            group :development do
         | 
| 22 | 
            +
              gem "capistrano"
         | 
| 23 | 
            +
            end
         | 
| @@ -20,5 +20,10 @@ Gem::Specification.new do |gem| | |
| 20 20 | 
             
              gem.add_runtime_dependency "haml"
         | 
| 21 21 |  | 
| 22 22 | 
             
              gem.add_development_dependency "rspec"
         | 
| 23 | 
            +
              gem.add_development_dependency "jasmine"
         | 
| 24 | 
            +
              gem.add_development_dependency "factory-girl"
         | 
| 25 | 
            +
              #gem.add_development_dependency "capybara"
         | 
| 26 | 
            +
              #gem.add_development_dependency "poltergeist"
         | 
| 27 | 
            +
             | 
| 23 28 | 
             
              gem.add_development_dependency "capistrano"
         | 
| 24 29 | 
             
            end
         | 
| @@ -1,2 +1,8 @@ | |
| 1 1 | 
             
            #!/usr/bin/env rake
         | 
| 2 | 
            -
            require "bundler/gem_tasks"
         | 
| 2 | 
            +
            require "bundler/gem_tasks"
         | 
| 3 | 
            +
            require "rspec/core/rake_task"
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            RSpec::Core::RakeTask.new do |task|
         | 
| 6 | 
            +
              task.rspec_opts =["-c", "-f progress", "-r ./spec/spec_helper.rb"]
         | 
| 7 | 
            +
              task.pattern = "spec/**/*_spec.rb"
         | 
| 8 | 
            +
            end
         | 
| @@ -0,0 +1,31 @@ | |
| 1 | 
            +
            # Use capybara to write application acceptance tests.
         | 
| 2 | 
            +
            # This setup is for testing headless with phantomjs, call set_driver
         | 
| 3 | 
            +
            # to use poltergeist, by default it uses selenium javascript driver
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            require_relative "spec_helper"
         | 
| 6 | 
            +
            require "capybara"
         | 
| 7 | 
            +
            require "capybara/dsl"
         | 
| 8 | 
            +
            require "capybara/rspec"
         | 
| 9 | 
            +
            require "capybara/poltergeist"
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            def app
         | 
| 12 | 
            +
              Rack::Builder.parse_file(File.expand_path(File.join(File.dirname(__FILE__), "../", "/config.ru")))
         | 
| 13 | 
            +
            end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            RSpec.configure do |config|
         | 
| 16 | 
            +
              config.include Capybara::DSL
         | 
| 17 | 
            +
              Capybara.app, _ = app
         | 
| 18 | 
            +
            end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            def set_driver(debug=false)
         | 
| 21 | 
            +
              Capybara.javascript_driver = :poltergeist
         | 
| 22 | 
            +
              if debug
         | 
| 23 | 
            +
                Capybara.register_driver :poltergeist do |app|
         | 
| 24 | 
            +
                  Capybara::Poltergeist::Driver.new(app, {:inspector=>true, :debug => true})
         | 
| 25 | 
            +
                end
         | 
| 26 | 
            +
              end
         | 
| 27 | 
            +
            end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
             | 
| 30 | 
            +
            # Uncomment the following line if you want to use poltergeist driver
         | 
| 31 | 
            +
            # set_driver
         | 
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            require_relative "<%=name%>"
         | 
| 2 | 
            +
            require 'rack/test'
         | 
| 3 | 
            +
            require 'rspec'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            require 'factory_girl'
         | 
| 6 | 
            +
            require 'factories'
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            # set test environment
         | 
| 9 | 
            +
            Sinatra::Base.set :environment, :test
         | 
| 10 | 
            +
            Sinatra::Base.set :run, false
         | 
| 11 | 
            +
            Sinatra::Base.set :raise_errors, true
         | 
| 12 | 
            +
            Sinatra::Base.set :logging, false
         | 
| 13 | 
            +
             | 
| 14 | 
            +
             | 
| 15 | 
            +
             | 
| 16 | 
            +
            module RackTestHelpers
         | 
| 17 | 
            +
              module MyApp
         | 
| 18 | 
            +
                def app
         | 
| 19 | 
            +
                  <%= name.camelize %>
         | 
| 20 | 
            +
                end
         | 
| 21 | 
            +
              end
         | 
| 22 | 
            +
            end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            RSpec.configure do |config|
         | 
| 25 | 
            +
              config.include Rack::Test::Methods
         | 
| 26 | 
            +
              config.include RackTestHelpers::MyApp
         | 
| 27 | 
            +
            end
         | 
    
        data/lib/myway/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: myway
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.5
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2012-09- | 
| 12 | 
            +
            date: 2012-09-29 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: thor
         | 
| @@ -72,6 +72,11 @@ files: | |
| 72 72 | 
             
            - lib/myway/templates/gitignore.tt
         | 
| 73 73 | 
             
            - lib/myway/templates/rakefile.tt
         | 
| 74 74 | 
             
            - lib/myway/templates/readme.tt
         | 
| 75 | 
            +
            - lib/myway/templates/spec/acceptance_helper.rb.tt
         | 
| 76 | 
            +
            - lib/myway/templates/spec/factories.rb.tt
         | 
| 77 | 
            +
            - lib/myway/templates/spec/fixtures.js.tt
         | 
| 78 | 
            +
            - lib/myway/templates/spec/specHelper.js.tt
         | 
| 79 | 
            +
            - lib/myway/templates/spec/spec_helper.rb.tt
         | 
| 75 80 | 
             
            - lib/myway/version.rb
         | 
| 76 81 | 
             
            - myway.gemspec
         | 
| 77 82 | 
             
            homepage: http://github.com/mftaher/myway
         | 
| @@ -99,3 +104,4 @@ signing_key: | |
| 99 104 | 
             
            specification_version: 3
         | 
| 100 105 | 
             
            summary: Scaffolding application for Sinatra web applications
         | 
| 101 106 | 
             
            test_files: []
         | 
| 107 | 
            +
            has_rdoc: 
         |