scaffold_cn 0.1.3 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3e2e49d11e21e7c488caee261c8b289562df087
4
- data.tar.gz: af6713ab5431465fe61af2c994974289a685b276
3
+ metadata.gz: 443fc531d199a2a09930b7c24254b74ea4263774
4
+ data.tar.gz: 8d8ad108cb358cb0909102784a5fd56715ccfbd2
5
5
  SHA512:
6
- metadata.gz: dc21399cc07ed047cef51fbc3f3d943a22ca8cf5f19d579dd463e56d41ef1e640d01a331c6250f30f44a078b1f8cc898fd8b38bdcf9673f0de748d826804d238
7
- data.tar.gz: 8dcb4986e14866c6fcb67fec3fdd49317a8fc495dd5fdb6dabd943d2e7e32a8dc73dc3f1dabcd17e1ce60d32065cdb071976c3141f42dd16a6e1ffccdf5b5bd3
6
+ metadata.gz: 35ba3b4dc71e43b941324f2ade601e106b63958dbe30eab1f6c81e61cee6e8c76c19f9bb35554e7e9d1c09f695df901b2c1db32df8dafa7e12b1ce973eac96c8
7
+ data.tar.gz: 009ddca39ed4894319b8e7c74e9090e0e73af3f95881501ff7afd21729e31dffe6f47c9fcd119fbbcf106aba9748b84c7197ec56d7913ae137a78b4b3183a2df
@@ -2,20 +2,19 @@
2
2
  class Scaffold_cnGenerator < Rails::Generators::Base
3
3
  source_root File.expand_path('../templates', __FILE__)
4
4
 
5
- def generate_scaffold_cn type
6
- puts "type: #{type}"
5
+ def generate_scaffold_cn
7
6
  templates = [
8
7
  'lib/templates/erb/scaffold/_form.html.erb',
9
8
  'lib/templates/erb/scaffold/edit.html.erb',
10
9
  'lib/templates/erb/scaffold/index.html.erb',
11
10
  'lib/templates/erb/scaffold/new.html.erb',
12
11
  'lib/templates/erb/scaffold/show.html.erb',
13
- 'config/locales/defaults/zh_CN.yml',
14
- 'config/locales/models/zh_CN.yml',
15
- 'config/locales/views/zh_CN.yml',
16
- 'config/locales/devise/zh_CN.yml']
12
+ 'config/locales/defaults.zh_CN.yml',
13
+ 'config/locales/models.zh_CN.yml',
14
+ 'config/locales/views.zh_CN.yml',
15
+ 'config/locales/devise.zh_CN.yml']
17
16
  templates.each do |path|
18
- template path, path
17
+ copy_file path, path
19
18
  end
20
19
  end
21
20
  end
@@ -1,4 +1,4 @@
1
- <h1><%=t(:edit)%> <%%= <%= human_name %>.model_name.human %></h1>
1
+ <h1> <%%=t(:edit)%><%%=<%= human_name %>.model_name.human %></h1>
2
2
 
3
3
  <%%= render 'form' %>
4
4
 
@@ -1,4 +1,4 @@
1
- <h1><%%= <%= human_name %>.model_name.human %><%=t(:index)%></h1>
1
+ <h1><%%= <%= human_name %>.model_name.human %><%%= t :index %></h1>
2
2
 
3
3
  <table>
4
4
  <thead>
@@ -26,4 +26,4 @@
26
26
 
27
27
  <br>
28
28
 
29
- <%%= link_to ('新增' + <%= human_name %>.model_name.human), new_<%= singular_table_name %>_path %>
29
+ <%%= link_to (t(:new) + <%= human_name %>.model_name.human), new_<%= singular_table_name %>_path %>
@@ -1,4 +1,4 @@
1
- <h1><%=t(:new)%><%%= <%= human_name %>.model_name.human %></h1>
1
+ <h1><%%=t(:new)%><%%=<%= human_name %>.model_name.human %></h1>
2
2
 
3
3
  <%%= render 'form' %>
4
4
 
@@ -1,3 +1,3 @@
1
1
  module ScaffoldCn
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaffold_cn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - homeway
@@ -32,10 +32,10 @@ extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
34
  - lib/generators/scaffold_cn/scaffold_cn_generator.rb
35
- - lib/generators/scaffold_cn/templates/config/locales/defaults/zh_CN.yml
36
- - lib/generators/scaffold_cn/templates/config/locales/devise/zh_CN.yml
37
- - lib/generators/scaffold_cn/templates/config/locales/models/zh_CN.yml
38
- - lib/generators/scaffold_cn/templates/config/locales/views/zh_CN.yml
35
+ - lib/generators/scaffold_cn/templates/config/locales/defaults.zh_CN.yml
36
+ - lib/generators/scaffold_cn/templates/config/locales/devise.zh_CN.yml
37
+ - lib/generators/scaffold_cn/templates/config/locales/models.zh_CN.yml
38
+ - lib/generators/scaffold_cn/templates/config/locales/views.zh_CN.yml
39
39
  - lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/_form.html.erb
40
40
  - lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/edit.html.erb
41
41
  - lib/generators/scaffold_cn/templates/lib/templates/erb/scaffold/index.html.erb