locale_kit 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cad57dffcc8fc54c538c4fd5e3f0b890e5f4026b
4
- data.tar.gz: 330aac41759c4773b76b5df8ca77a66cf1ea4aeb
3
+ metadata.gz: cfdb2ddeace448d58ee288a648bd5f1bbda7dcdb
4
+ data.tar.gz: 32c390fb94e4d3b4784c2c6fc7ae08e76ff62470
5
5
  SHA512:
6
- metadata.gz: 849fad4ac735c566b1391f17a6f5b5fad5b0a9c3963d12a82edec42e923ffa15d783809a8bb2247a9309a3d4363d79e550a962ce26c2d5aeeb1e74bd638156f7
7
- data.tar.gz: ec8b1fe11c1884ab3afa6a61c9d30513f59a84c5ebd5370774a37bfa7eeaad4d414ef2c217b43a1dae67a1c5d21dad7eacb120ac9e885f7f74141baf6a0ebc74
6
+ metadata.gz: 938dfe4f452cf90ea49527b4a485ce2ee61b3fdb414cdf41cb522bab5c4c9bbb559b7a1b37349f3a3953b800df48411736c4f1d7e2f5fdc85de346af921150b0
7
+ data.tar.gz: 1398f3df4d9f0709284848766719e8ea2752212b427b49d79b8c87194847d52fc886b01d86deeee1a9d60d4dd4f5ffc529f484793c11aa7f0814b823798adbe2
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # LocaleKit
2
2
 
3
+ [![Gem](https://img.shields.io/gem/v/locale_kit.svg)](https://rubygems.org/gems/locale_kit)
4
+ [![Downloads](https://img.shields.io/gem/dt/locale_kit.svg)](https://rubygems.org/gems/locale_kit)
5
+ [![CircleCI](https://img.shields.io/circleci/project/github/space-pirates-llc/locale_kit.svg)](https://circleci.com/gh/space-pirates-llc/locale_kit)
6
+ [![Coveralls](https://img.shields.io/coveralls/space-pirates-llc/locale_kit.svg)](https://coveralls.io/github/space-pirates-llc/locale_kit)
7
+
3
8
  Provides new convention of locales and useful generators for Rails components.
4
9
 
5
10
  ## Installation
@@ -24,7 +29,7 @@ $ ./bin/rails locale_kit:install
24
29
 
25
30
  ## Contributing
26
31
 
27
- 1. Fork it ( https://github.com/space-pirates/locale_kit/fork )
32
+ 1. Fork it ( https://github.com/space-pirates-llc/locale_kit/fork )
28
33
  2. Create your feature branch (`git checkout -b my-new-feature`)
29
34
  3. Commit your changes (`git commit -am 'Add some feature'`)
30
35
  4. Push to the branch (`git push origin my-new-feature`)
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  begin
3
4
  require 'bundler/setup'
4
5
  rescue LoadError
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class LocaleKit::ApplicationController < ActionController::Base
3
4
  protect_from_forgery with: :exception
4
5
  end
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module LocaleKit::ApplicationHelper
3
4
  end
data/config/routes.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  LocaleKit::Engine.routes.draw do
3
4
  end
@@ -6,7 +6,7 @@ module LocaleKit
6
6
  private
7
7
 
8
8
  def locale_dir
9
- Rails.root.join(LocaleKit.config.directory)
9
+ Pathname.new(LocaleKit.config.directory)
10
10
  end
11
11
  end
12
12
  end
@@ -18,7 +18,7 @@ class LocaleKit::Generators::ControllerGenerator < LocaleKit::Generators::Base
18
18
  attr_accessor :current_locale
19
19
 
20
20
  def namespaces
21
- (class_path + [file_name + '_mailer'])
21
+ @namespaces ||= (class_path + [file_name])
22
22
  end
23
23
 
24
24
  def locale_namespace
@@ -3,9 +3,9 @@
3
3
  <% if action_names.empty? -%>
4
4
  <%= " " * (namespaces.size + 1) %>action_name:
5
5
  <%= " " * (namespaces.size + 2) %>key: "value"
6
- <%- else -%>
6
+ <% else -%>
7
7
  <% action_names.each do |action_name| -%>
8
8
  <%= " " * (namespaces.size + 1) %><%= action_name %>:
9
9
  <%= " " * (namespaces.size + 2) %>key: "value"
10
10
  <% end -%>
11
- <%- end -%>
11
+ <% end -%>
@@ -3,9 +3,9 @@
3
3
  <% if action_names.empty? -%>
4
4
  <%= " " * (namespaces.size + 1) %>view_name:
5
5
  <%= " " * (namespaces.size + 2) %>key: "value"
6
- <%- else -%>
6
+ <% else -%>
7
7
  <% action_names.each do |action_name| -%>
8
8
  <%= " " * (namespaces.size + 1) %><%= action_name %>:
9
9
  <%= " " * (namespaces.size + 2) %>title: "<%= action_name.classify %>"
10
10
  <% end -%>
11
- <%- end -%>
11
+ <% end -%>
@@ -19,7 +19,7 @@ class LocaleKit::Generators::InstallGenerator < ::Rails::Generators::Base
19
19
  attr_accessor :current_locale
20
20
 
21
21
  def locale_dir
22
- Rails.root.join(LocaleKit.config.directory)
22
+ Pathname.new(LocaleKit.config.directory)
23
23
  end
24
24
 
25
25
  def app_name
@@ -17,7 +17,7 @@ class LocaleKit::Generators::MailerGenerator < LocaleKit::Generators::Base
17
17
  attr_accessor :current_locale
18
18
 
19
19
  def namespaces
20
- (class_path + [file_name])
20
+ (class_path + [file_name + '_mailer'])
21
21
  end
22
22
 
23
23
  def locale_namespace
@@ -3,9 +3,9 @@
3
3
  <% if action_names.empty? -%>
4
4
  <%= " " * (namespaces.size + 1) %>action_name:
5
5
  <%= " " * (namespaces.size + 2) %>subject: "Subject"
6
- <%- else -%>
6
+ <% else -%>
7
7
  <% action_names.each do |action_name| -%>
8
8
  <%= " " * (namespaces.size + 1) %><%= action_name %>:
9
9
  <%= " " * (namespaces.size + 2) %>subject: "<%= action_name.classify %>"
10
10
  <% end -%>
11
- <%- end -%>
11
+ <% end -%>
@@ -20,14 +20,6 @@ class LocaleKit::Generators::ModelGenerator < LocaleKit::Generators::Base
20
20
  defined?(ActiveRecord) ? :activerecord : :activemodel
21
21
  end
22
22
 
23
- def namespaces
24
- (class_path + [file_name])
25
- end
26
-
27
- def locale_namespace
28
- namespaces.map.with_index(1) { |name, idx| (' ' * idx) + name + ':' }.join("\n")
29
- end
30
-
31
23
  def model_name
32
24
  (class_path + [file_name]).join('/')
33
25
  end
data/lib/locale_kit.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'locale_kit/version'
3
4
  require 'locale_kit/config'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class LocaleKit::Engine < ::Rails::Engine
3
4
  isolate_namespace LocaleKit
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module LocaleKit
3
- VERSION = '0.0.1'.freeze
4
+ VERSION = '0.0.2'.freeze
4
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locale_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Kusano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-04 00:00:00.000000000 Z
11
+ date: 2017-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coveralls
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description: Improve locales convention of Rails
84
98
  email:
85
99
  - sho-kusano@space-pirates.jp
@@ -118,7 +132,7 @@ files:
118
132
  - lib/locale_kit/engine.rb
119
133
  - lib/locale_kit/version.rb
120
134
  - lib/tasks/locale_kit_tasks.rake
121
- homepage: https://github.com/space-priates/locale_kit
135
+ homepage: https://github.com/space-pirates-llc/locale_kit
122
136
  licenses:
123
137
  - MIT
124
138
  metadata: {}