railsone 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5b0023b5dc13f18a28f0fd526a30d787230d40b9
4
+ data.tar.gz: 4b2a693e7fbbc86d5bbffd6d7b6aa65fd6dd8a2e
5
+ SHA512:
6
+ metadata.gz: 0a03b8fbf40533f11aa1fa2444535e07f2a2c33d7ff13954794d668f6f6acc504d8e60c6f7508e13760b8ff764c0eeacf40a07948fbe37a2f93bd33745591a2f
7
+ data.tar.gz: 1b654063f9b95562793ecb8cfc0535f08dea26b34e5bf780a537009b6d824dfadeb987b716d83c0a8993a9a7baa11ea37a8e48934a18ab81ae94ee746be0132f
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in railsone.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 weichienhung
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Railsone
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'railsone'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install railsone
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,117 @@
1
+ require 'rails/generators'
2
+ require 'railsone/generators/install_helper'
3
+
4
+ module Railsone
5
+ module Generators
6
+ class InstallGenerator < ::Rails::Generators::Base
7
+ # def self.root_folder
8
+ # File.expand_path '../..', __FILE__
9
+ # end
10
+ include Railsone::Helper
11
+
12
+ desc "generator to create emberjs and twitter bootstrap"
13
+
14
+ #class_option :my_opt, :type => :boolean, :default => false, :desc => "My Option"
15
+
16
+ self.source_paths << File.join(File.dirname(__FILE__), '../../../templates')
17
+ #self.source_paths << File.join(self.root_folder , 'templates')
18
+
19
+ def setup_all_gems_with_bundle_install
20
+ gem 'ember-rails'
21
+ gem 'ember-source', '1.0.0'
22
+ gem 'anjlab-bootstrap-rails', '>= 3.0.0', :require => 'bootstrap-rails'
23
+
24
+ comment_lines 'Gemfile', 'gem \'sqlite3\''
25
+ # gsub_file 'Gemfile', 'gem \'sqlite3\'', '#gem \'sqlite3\''
26
+ gem_group :development do
27
+ gem "powder"
28
+ gem 'dotenv-rails'
29
+ gem 'sqlite3'
30
+ end
31
+
32
+ say "create .env for dotenv-rails"
33
+ create_file '.env'
34
+
35
+ say "set gems for production on heroku"
36
+ gem_group :production do
37
+ gem 'pg'
38
+ gem 'thin'
39
+ end
40
+
41
+ run 'bundle install'
42
+ end
43
+
44
+ def secure_secret_token_from_env
45
+ comment_lines 'config/initializers/secret_token.rb', /config.secret_key_base/
46
+ append_to_file 'config/initializers/secret_token.rb', "#{app_name}::Application.config.secret_key_base = ENV['SECRET_TOKEN']"
47
+ secret_token = SecureRandom.urlsafe_base64(64, false)
48
+ append_to_file '.env' , "SECRET_TOKEN=#{secret_token}\n"
49
+ end
50
+
51
+ def init_emberjs_structure
52
+ generate 'ember:bootstrap'
53
+ route "root 'portal#index'"
54
+
55
+ application(nil, env: "development") do
56
+ "config.ember.variant = :development"
57
+ end
58
+
59
+ application(nil, env: "production") do
60
+ "config.ember.variant = :production"
61
+ end
62
+
63
+ remove_file 'app/assets/javascripts/application.js'
64
+ remove_file "app/assets/javascripts/store.js.coffee"
65
+
66
+ copy_file 'app/assets/javascripts/application.js', 'app/assets/javascripts/application.js'
67
+ copy_file 'app/assets/javascripts/portal.js', 'app/assets/javascripts/portal.js'
68
+ copy_file 'app/assets/javascripts/templates/application.hbs', 'app/assets/javascripts/templates/application.hbs'
69
+ copy_file 'app/views/portal/index.html.erb', 'app/views/portal/index.html.erb'
70
+ copy_file 'app/controllers/portal_controller.rb', 'app/controllers/portal_controller.rb'
71
+
72
+ inject_into_file 'app/assets/javascripts/portal.js', :after => "//= require ember" do
73
+ "\n//= require #{app_name.underscore}"
74
+ end
75
+
76
+ remove_file "app/assets/javascripts/#{app_name.underscore}.js.coffee"
77
+ template 'app/assets/javascripts/app_name.js.coffee.erb', "app/assets/javascripts/#{app_name.underscore}.js.coffee"
78
+ end
79
+
80
+ def init_twitter_bootstrap_css
81
+ #inject_into_file 'app/assets/javascripts/application.js', "\n//= require twitter/bootstrap\n", :after => "//= require turbolinks"
82
+
83
+ remove_file 'app/assets/stylesheets/application.css'
84
+ # create_file "app/assets/stylesheets/application.css.scss" do
85
+ # %Q(//= require_self\n//= require common)
86
+ # end
87
+
88
+ # create_file "app/assets/stylesheets/common.css.scss" do
89
+ # %q(@import "twitter/bootstrap";)
90
+ # end
91
+
92
+ copy_file 'app/assets/stylesheets/application.css.scss', 'app/assets/stylesheets/application.css.scss'
93
+ copy_file 'app/assets/stylesheets/common.css.scss', 'app/assets/stylesheets/common.css.scss'
94
+ #directory 'stylesheets', 'app/assets/stylesheets'
95
+ end
96
+
97
+ def replace_application_html_erb
98
+ remove_file 'app/views/layouts/application.html.erb'
99
+ copy_file 'app/views/layouts/application.html.erb', 'app/views/layouts/application.html.erb'
100
+ inject_into_file 'app/views/layouts/application.html.erb', "\n<title>#{app_name}</title>", :after => %Q(<meta name="viewport" content="width=device-width, initial-scale=1.0">)
101
+ end
102
+
103
+ def init_git
104
+ git :init
105
+ end
106
+
107
+ def set_ignore_file_to_git
108
+ append_to_file '.gitignore', '.env'
109
+ end
110
+ # def devise_init
111
+ # gem "devise", "~> 3.1.0"
112
+ # generate 'devise:install'
113
+ # end
114
+
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,8 @@
1
+ module Railsone
2
+ module Helper
3
+ def app_name
4
+ Rails.application.class.name.split('::').first
5
+ end
6
+
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module Railsone
2
+ VERSION = "0.0.1"
3
+ end
data/lib/railsone.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "railsone/version"
2
+ require "railsone/generators/install_generator"
3
+
4
+ module Railsone
5
+ # Your code goes here...
6
+ end
data/railsone.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'railsone/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "railsone"
8
+ spec.version = Railsone::VERSION
9
+ spec.authors = ["weichienhung"]
10
+ spec.email = ["weichien.hung@gmail.com"]
11
+ spec.description = %q{Rails 1 helps you create emberjs 1.0 with twitter bootstrap 3.0}
12
+ spec.summary = %q{Create emberjs with twitter bootstrap}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+
24
+ end
@@ -0,0 +1,10 @@
1
+ #= require_self
2
+ #= require_tree ./models
3
+ #= require_tree ./controllers
4
+ #= require_tree ./views
5
+ #= require_tree ./helpers
6
+ #= require_tree ./templates
7
+ #= require_tree ./routes
8
+ #= require ./router
9
+ window.<%= app_name %> = Ember.Application.create
10
+ rootElement: '#application'
@@ -0,0 +1,17 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require twitter/bootstrap
17
+
@@ -0,0 +1,3 @@
1
+ //= require handlebars
2
+ //= require ember
3
+ //= require_self
@@ -0,0 +1 @@
1
+ <h1> Hello Ember </h1>
@@ -0,0 +1,2 @@
1
+ //= require_self
2
+ //= require common
@@ -0,0 +1 @@
1
+ @import "twitter/bootstrap";
@@ -0,0 +1,6 @@
1
+ class PortalController < ApplicationController
2
+
3
+ def index
4
+ end
5
+
6
+ end
@@ -0,0 +1,35 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+
8
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
9
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
10
+ <%= csrf_meta_tags %>
11
+ </head>
12
+ <body>
13
+
14
+ <div class="container">
15
+
16
+ <%= yield %>
17
+
18
+ <div id="application"></div>
19
+
20
+ <% if not notice.blank? %>
21
+ <div class="alert alert-success alert-dismissable">
22
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
23
+ <%= notice %>
24
+ </div>
25
+ <% end %>
26
+ <% if not alert.blank? %>
27
+ <div class="alert alert-warning alert-dismissable">
28
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
29
+ <%= alert %>
30
+ </div>
31
+ <% end %>
32
+ </div>
33
+
34
+ </body>
35
+ </html>
@@ -0,0 +1 @@
1
+ <%= javascript_include_tag "portal" %>
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: railsone
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - weichienhung
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Rails 1 helps you create emberjs 1.0 with twitter bootstrap 3.0
42
+ email:
43
+ - weichien.hung@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - lib/railsone.rb
54
+ - lib/railsone/generators/install_generator.rb
55
+ - lib/railsone/generators/install_helper.rb
56
+ - lib/railsone/version.rb
57
+ - railsone.gemspec
58
+ - templates/app/assets/javascripts/app_name.js.coffee.erb
59
+ - templates/app/assets/javascripts/application.js
60
+ - templates/app/assets/javascripts/portal.js
61
+ - templates/app/assets/javascripts/templates/application.hbs
62
+ - templates/app/assets/stylesheets/application.css.scss
63
+ - templates/app/assets/stylesheets/common.css.scss
64
+ - templates/app/controllers/portal_controller.rb
65
+ - templates/app/views/layouts/application.html.erb
66
+ - templates/app/views/portal/index.html.erb
67
+ homepage: ''
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 2.0.7
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: Create emberjs with twitter bootstrap
91
+ test_files: []