russpeeddev 0.0.1.1
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.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/CHANGELOG.MD +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +51 -0
- data/Rakefile +2 -0
- data/lib/generators/russpeeddev/russpeeddev_generator.rb +91 -0
- data/lib/generators/russpeeddev/templates/_footer.html.slim +5 -0
- data/lib/generators/russpeeddev/templates/_header.html.slim +12 -0
- data/lib/generators/russpeeddev/templates/_mainmenu.html.slim +6 -0
- data/lib/generators/russpeeddev/templates/_meta.html.slim +18 -0
- data/lib/generators/russpeeddev/templates/_nojs.html +4 -0
- data/lib/generators/russpeeddev/templates/_outdate.html +1 -0
- data/lib/generators/russpeeddev/templates/application.html.slim +18 -0
- data/lib/generators/russpeeddev/templates/application_helper.rb +12 -0
- data/lib/russpeeddev/version.rb +8 -0
- data/lib/russpeeddev.rb +6 -0
- data/russpeeddev.gemspec +25 -0
- metadata +90 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dab8c98926cb8ffc3dc2725dd723014018eae0e4
|
4
|
+
data.tar.gz: 1d47f880b88c46f2cf540f9f611a7edae8c5a6c4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d8339210798793ef2d643dce4f1716a6f8dedd2024bd665ee57652dc2f9af118915b4f674352f27f6a9394d46f1a8802c965c655b5d0dcf25175d0089b646bcb
|
7
|
+
data.tar.gz: 0d6fd4052e8e62ff707b52f7d12513da6c7ad5a7c520d83ac4b49f855e2ddcb8b47efa1d83b289058c367be87916c2eba65a7e1cbf94335e184b2573a649bb2d
|
data/.gitignore
ADDED
data/CHANGELOG.MD
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 vasche
|
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,51 @@
|
|
1
|
+
# Russpeeddev
|
2
|
+
|
3
|
+
Генерирует куски кода для быстрого старта разработки нового приложения.
|
4
|
+
|
5
|
+
Для rails 4.0.0.rc1.
|
6
|
+
|
7
|
+
## Что это такое?
|
8
|
+
|
9
|
+
Гем генерирует некоторые константы.
|
10
|
+
* Добавляестя текст в Gemfile (список гемов).
|
11
|
+
* Используется шаблонизатор slim
|
12
|
+
* Генерируется контроллер pages для статических страниц index about contact
|
13
|
+
* Добавляется текст в routes.rb
|
14
|
+
* Добавляется хелпер метод title
|
15
|
+
* Меняется шаблон application
|
16
|
+
* Добавляются куски шаблонов в views/shared
|
17
|
+
* TODO: Поменять часовой пояс и локаль в application.rb
|
18
|
+
|
19
|
+
|
20
|
+
## Установка
|
21
|
+
|
22
|
+
Добавить строку в Gemfile:
|
23
|
+
|
24
|
+
gem 'russpeeddev', git: 'https://github.com/vasche/russpeeddev.git'
|
25
|
+
|
26
|
+
Затем выполнить:
|
27
|
+
|
28
|
+
$ bundle update
|
29
|
+
|
30
|
+
Или установить в ручном режиме командой:
|
31
|
+
|
32
|
+
$ gem install russpeeddev
|
33
|
+
|
34
|
+
## Использование
|
35
|
+
|
36
|
+
Создать новое приложение, установить этот гем в Gemfile (выполнить bundle) , выполнить команду:
|
37
|
+
|
38
|
+
$ rails g russpeeddev
|
39
|
+
|
40
|
+
## Баги rails 4.0.0.rc1
|
41
|
+
|
42
|
+
Есть проблема с зависимостями slim-rails, slim и tilt 1.4.0. Решается запуском bundle update и повторной генерации russpeeddev
|
43
|
+
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
1. Fork it
|
48
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
49
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
50
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
51
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
module Russpeeddev
|
3
|
+
module Generators
|
4
|
+
class RusspeeddevGenerator < Rails::Generators::Base
|
5
|
+
require 'thor'
|
6
|
+
desc "This generator creates templates files to speed up rails development"
|
7
|
+
namespace "russpeeddev"
|
8
|
+
source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
9
|
+
|
10
|
+
def add_to_gemfile
|
11
|
+
#add gems to Gemfiles and run bundle install
|
12
|
+
append_to_file 'Gemfile' do
|
13
|
+
"\n
|
14
|
+
#-------------------------------
|
15
|
+
# Added by gem russpeeddev
|
16
|
+
# uncomment what you need
|
17
|
+
#-------------------------------
|
18
|
+
gem 'russian'
|
19
|
+
gem 'slim', '~> 1.3.8'
|
20
|
+
gem 'slim-rails', '~> 1.1.1'
|
21
|
+
gem 'tilt', '~> 1.3.7'
|
22
|
+
gem 'kaminari'
|
23
|
+
gem 'bootstrap-sass'
|
24
|
+
#gem 'thinking-sphinx'
|
25
|
+
#gem 'delayed_job_active_record'
|
26
|
+
#gem 'devise'
|
27
|
+
#gem 'devise-russian', '~> 2.0.1.1'
|
28
|
+
#gem 'activeadmin'
|
29
|
+
#gem 'meta_search', '>= 1.1.0.pre'
|
30
|
+
|
31
|
+
group :test do
|
32
|
+
gem 'rspec-rails'
|
33
|
+
gem 'webrat'
|
34
|
+
gem 'factory_girl_rails'
|
35
|
+
end
|
36
|
+
|
37
|
+
group :development do
|
38
|
+
gem 'rspec-rails'
|
39
|
+
gem 'quiet_assets' #hide logs
|
40
|
+
#gem 'rails_best_practices'
|
41
|
+
end
|
42
|
+
|
43
|
+
#-------------------------------
|
44
|
+
# End gem russpeeddev.
|
45
|
+
#-------------------------------
|
46
|
+
"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def run_bundle_update
|
51
|
+
run('bundle update')
|
52
|
+
end
|
53
|
+
|
54
|
+
def generate_static_pages
|
55
|
+
generate("controller", "pages index about contact")
|
56
|
+
end
|
57
|
+
|
58
|
+
def add_root_to_routes
|
59
|
+
insert_into_file "config/routes.rb" , after: "#{Rails.application.class.parent_name}::Application.routes.draw do" do
|
60
|
+
"\n root 'pages#index'\n get 'about' => 'pages#about'\n get 'contact' => 'pages#contact'"
|
61
|
+
end
|
62
|
+
comment_lines 'config/routes.rb', 'get "pages/index"'
|
63
|
+
comment_lines 'config/routes.rb', 'get "pages/about"'
|
64
|
+
comment_lines 'config/routes.rb', 'get "pages/contact"'
|
65
|
+
end
|
66
|
+
|
67
|
+
def create_custom_css_scss
|
68
|
+
create_file "app/assets/stylesheets/custom.css.scss" do
|
69
|
+
"@import 'bootstrap';\n@import 'bootstrap-responsive';"
|
70
|
+
end
|
71
|
+
insert_into_file "app/assets/stylesheets/application.css" , before: "*/" do
|
72
|
+
"*= require custom\n"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def copy_shared_templates
|
77
|
+
template "_footer.html.slim", "app/views/shared/_footer.html.slim"
|
78
|
+
template "_header.html.slim", "app/views/shared/_header.html.slim"
|
79
|
+
template "_mainmenu.html.slim", "app/views/shared/_mainmenu.html.slim"
|
80
|
+
template "_meta.html.slim", "app/views/shared/_meta.html.slim"
|
81
|
+
template "_nojs.html", "app/views/shared/_nojs.html"
|
82
|
+
template "_outdate.html", "app/views/shared/_outdate.html"
|
83
|
+
remove_file 'app/helpers/application_helper.rb'
|
84
|
+
template "application_helper.rb", "app/helpers/application_helper.rb"
|
85
|
+
remove_file 'app/views/layouts/application.html.erb'
|
86
|
+
template "application.html.slim", "app/views/layouts/application.html.slim"
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
meta charset="UTF-8"
|
2
|
+
/!Le HTML5 shim, for IE6-8 support of HTML elements
|
3
|
+
/![if lt IE 9]
|
4
|
+
script src="http://html5shim.googlecode.com/svn/trunk/html5.js"
|
5
|
+
/![endif]
|
6
|
+
meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"
|
7
|
+
meta name="description" content="Rails New App"
|
8
|
+
link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"
|
9
|
+
meta name="keywords" content="Rails New App"
|
10
|
+
meta name="author" content="github.com/vasche"
|
11
|
+
meta name="viewport" content="width=device-width, initial-scale=1.0"
|
12
|
+
/ie9
|
13
|
+
meta name="application-name" content='about_content'
|
14
|
+
meta name="msapplication-tooltip" content='about_content'
|
15
|
+
meta name="msapplication-starturl" content=""
|
16
|
+
meta name="msapplication-window" content="width=1024;height=650"
|
17
|
+
meta name="msapplication-navbutton-color" content="black"
|
18
|
+
/endie9
|
@@ -0,0 +1 @@
|
|
1
|
+
<!--[if lt IE 7]><p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p><![endif]-->
|
@@ -0,0 +1,18 @@
|
|
1
|
+
doctype html
|
2
|
+
=render 'shared/nojs'
|
3
|
+
html
|
4
|
+
head
|
5
|
+
title = title
|
6
|
+
= stylesheet_link_tag "application", media: "all"
|
7
|
+
= csrf_meta_tags
|
8
|
+
= render 'shared/meta'
|
9
|
+
|
10
|
+
body *{class: controller.controller_name}
|
11
|
+
=render 'shared/outdate'
|
12
|
+
header
|
13
|
+
= render 'shared/mainmenu'
|
14
|
+
.content
|
15
|
+
= yield
|
16
|
+
=render 'shared/footer'
|
17
|
+
/!javascript include here
|
18
|
+
=javascript_include_tag "application"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
module ApplicationHelper
|
3
|
+
def title
|
4
|
+
#возвращает заголовок на страницу
|
5
|
+
base_title = "#{Rails.application.class.parent_name} - this is ApplicationHelper method"
|
6
|
+
if @title.nil?
|
7
|
+
base_title
|
8
|
+
else
|
9
|
+
"#{base_title} | #{@title}"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/russpeeddev.rb
ADDED
data/russpeeddev.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'russpeeddev/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "russpeeddev"
|
8
|
+
spec.version = Russpeeddev::VERSION
|
9
|
+
spec.authors = ["vasche"]
|
10
|
+
spec.email = ["cho.vasche@gmail.com"]
|
11
|
+
spec.description = %q{Add shared layou teplates to speed up development new application}
|
12
|
+
spec.summary = %q{Add shared layou teplates to speed up development new application}
|
13
|
+
spec.homepage = "https://github.com/vasche"
|
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
|
+
spec.rubyforge_project = "russpeeddev"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: russpeeddev
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- vasche
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-04 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: Add shared layou teplates to speed up development new application
|
42
|
+
email:
|
43
|
+
- cho.vasche@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- CHANGELOG.MD
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- lib/generators/russpeeddev/russpeeddev_generator.rb
|
55
|
+
- lib/generators/russpeeddev/templates/_footer.html.slim
|
56
|
+
- lib/generators/russpeeddev/templates/_header.html.slim
|
57
|
+
- lib/generators/russpeeddev/templates/_mainmenu.html.slim
|
58
|
+
- lib/generators/russpeeddev/templates/_meta.html.slim
|
59
|
+
- lib/generators/russpeeddev/templates/_nojs.html
|
60
|
+
- lib/generators/russpeeddev/templates/_outdate.html
|
61
|
+
- lib/generators/russpeeddev/templates/application.html.slim
|
62
|
+
- lib/generators/russpeeddev/templates/application_helper.rb
|
63
|
+
- lib/russpeeddev.rb
|
64
|
+
- lib/russpeeddev/version.rb
|
65
|
+
- russpeeddev.gemspec
|
66
|
+
homepage: https://github.com/vasche
|
67
|
+
licenses:
|
68
|
+
- MIT
|
69
|
+
metadata: {}
|
70
|
+
post_install_message:
|
71
|
+
rdoc_options: []
|
72
|
+
require_paths:
|
73
|
+
- lib
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
requirements: []
|
85
|
+
rubyforge_project: russpeeddev
|
86
|
+
rubygems_version: 2.0.3
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: Add shared layou teplates to speed up development new application
|
90
|
+
test_files: []
|