simple_form_language_input 0.1.0

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: d0a58b862aa9dc06b39681de77e6e47a3c5ab4da
4
+ data.tar.gz: 81bdec35cfcadab3b04699cb349c59a947f9cac0
5
+ SHA512:
6
+ metadata.gz: bb5cce37bb52e0bcec5ccf29af8a3082ddbfa1d50a9901f03d812d49eb4bbaa733ce59c5da18e55e275ac81735b28f6ed96fa024c47e1b6afd7bb5c605e90a12
7
+ data.tar.gz: 064770bd895e9bda55dba7dc713f2b42ea8bc1733bb40fe2d1220fcd298a22a17c63deb0edea195f77d39ceda785c1e9739c420942ecd183aaf05486418cca2c
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --require spec_helper
3
+ --format progress
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.0
5
+ before_install: gem install bundler -v 1.14.3
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in simple_form_language_input.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,115 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ simple_form_language_input (0.1.0)
5
+ rails_language_select
6
+ simple_form
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (5.0.1)
12
+ actionview (= 5.0.1)
13
+ activesupport (= 5.0.1)
14
+ rack (~> 2.0)
15
+ rack-test (~> 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (5.0.1)
19
+ activesupport (= 5.0.1)
20
+ builder (~> 3.1)
21
+ erubis (~> 2.7.0)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
+ activemodel (5.0.1)
25
+ activesupport (= 5.0.1)
26
+ activesupport (5.0.1)
27
+ concurrent-ruby (~> 1.0, >= 1.0.2)
28
+ i18n (~> 0.7)
29
+ minitest (~> 5.1)
30
+ tzinfo (~> 1.1)
31
+ builder (3.2.3)
32
+ coderay (1.1.1)
33
+ concurrent-ruby (1.0.4)
34
+ diff-lcs (1.3)
35
+ erubis (2.7.0)
36
+ i18n (0.8.1)
37
+ i18n_data (0.7.0)
38
+ loofah (2.0.3)
39
+ nokogiri (>= 1.5.9)
40
+ method_source (0.8.2)
41
+ mini_portile (0.5.3)
42
+ minitest (5.10.1)
43
+ nokogiri (1.6.0)
44
+ mini_portile (~> 0.5.0)
45
+ pry (0.10.4)
46
+ coderay (~> 1.1.0)
47
+ method_source (~> 0.8.1)
48
+ slop (~> 3.4)
49
+ pry-nav (0.2.4)
50
+ pry (>= 0.9.10, < 0.11.0)
51
+ rack (2.0.1)
52
+ rack-test (0.6.3)
53
+ rack (>= 1.0)
54
+ rails-dom-testing (2.0.2)
55
+ activesupport (>= 4.2.0, < 6.0)
56
+ nokogiri (~> 1.6)
57
+ rails-html-sanitizer (1.0.3)
58
+ loofah (~> 2.0)
59
+ rails_language_select (0.2.2)
60
+ i18n_data (~> 0.7.0)
61
+ sort_alphabetical (~> 1.0)
62
+ railties (5.0.1)
63
+ actionpack (= 5.0.1)
64
+ activesupport (= 5.0.1)
65
+ method_source
66
+ rake (>= 0.8.7)
67
+ thor (>= 0.18.1, < 2.0)
68
+ rake (10.5.0)
69
+ rspec (3.5.0)
70
+ rspec-core (~> 3.5.0)
71
+ rspec-expectations (~> 3.5.0)
72
+ rspec-mocks (~> 3.5.0)
73
+ rspec-core (3.5.4)
74
+ rspec-support (~> 3.5.0)
75
+ rspec-expectations (3.5.0)
76
+ diff-lcs (>= 1.2.0, < 2.0)
77
+ rspec-support (~> 3.5.0)
78
+ rspec-mocks (3.5.0)
79
+ diff-lcs (>= 1.2.0, < 2.0)
80
+ rspec-support (~> 3.5.0)
81
+ rspec-rails (3.5.2)
82
+ actionpack (>= 3.0)
83
+ activesupport (>= 3.0)
84
+ railties (>= 3.0)
85
+ rspec-core (~> 3.5.0)
86
+ rspec-expectations (~> 3.5.0)
87
+ rspec-mocks (~> 3.5.0)
88
+ rspec-support (~> 3.5.0)
89
+ rspec-support (3.5.0)
90
+ simple_form (3.4.0)
91
+ actionpack (> 4, < 5.1)
92
+ activemodel (> 4, < 5.1)
93
+ slop (3.6.0)
94
+ sort_alphabetical (1.1.0)
95
+ unicode_utils (>= 1.2.2)
96
+ thor (0.19.4)
97
+ thread_safe (0.3.6)
98
+ tzinfo (1.2.2)
99
+ thread_safe (~> 0.1)
100
+ unicode_utils (1.4.0)
101
+
102
+ PLATFORMS
103
+ ruby
104
+
105
+ DEPENDENCIES
106
+ bundler (~> 1.14)
107
+ pry (~> 0)
108
+ pry-nav
109
+ rake (~> 10.0)
110
+ rspec (~> 3.0)
111
+ rspec-rails (~> 3.5)
112
+ simple_form_language_input!
113
+
114
+ BUNDLED WITH
115
+ 1.14.3
data/MIT-LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Kaspars
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # Simple Form Language Input
2
+
3
+ Simple Form input component for displaying a localised `<select>` of languages using the ISO 369 standard or your own custom data source.
4
+
5
+ Uses: https://github.com/kasparsj/rails_language_select
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'simple_form_language_input'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install simple_form_language_input
22
+
23
+ ## Usage
24
+
25
+ Simple usage:
26
+
27
+ ```ruby
28
+ f.input :language_code, as: :language
29
+ ```
30
+
31
+ Supplying priority languages to be placed at the top of the list:
32
+
33
+ ```ruby
34
+ f.input :language_code, as: :language, priority: ["EN", "FR", "DE"]
35
+ ```
36
+
37
+ Supplying only certain languages:
38
+
39
+ ```ruby
40
+ f.input :language_code, as: :language, only: ["EN", "FR", "DR"]
41
+ ```
42
+
43
+ Discarding certain languages:
44
+
45
+ ```ruby
46
+ f.input :language_code, as: :language, except: ["EN", "FR", "DE"]
47
+ ```
48
+
49
+ Using existing `select` options:
50
+ ```ruby
51
+ f.input :language_code, as: :language, include_blank: true
52
+ f.input :language_code, as: :language, include_blank: 'Select a language', input_html: { class: 'language-select-box' })
53
+ ```
54
+
55
+ Supplying additional html options:
56
+
57
+ ```ruby
58
+ f.input :language_code, as: :language, priority: ["EN", "FR"], input_html: { class: 'form-control', data: { attribute: "value" } })
59
+ ```
60
+
61
+ ## License
62
+
63
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
64
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,25 @@
1
+ require 'simple_form'
2
+ require 'rails_language_select'
3
+
4
+ require "simple_form_language_input/version"
5
+
6
+ module SimpleForm
7
+ # Default priority for language inputs.
8
+ mattr_accessor :language_priority
9
+ @@language_priority = nil
10
+
11
+ module Inputs
12
+ class LanguageInput < PriorityInput
13
+ def input_type
14
+ :language
15
+ end
16
+ def input_priority
17
+ input_priority = super
18
+ if input_priority.respond_to? :call
19
+ input_priority = input_priority.call
20
+ end
21
+ input_priority
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,3 @@
1
+ module SimpleFormLanguageInput
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'simple_form_language_input/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "simple_form_language_input"
8
+ spec.version = SimpleFormLanguageInput::VERSION
9
+ spec.authors = ["Kaspars"]
10
+ spec.email = ["kasparsj@gmail.com"]
11
+
12
+ spec.summary = "Simple Form language input"
13
+ spec.description = "Simple Form language input"
14
+ spec.homepage = "https://github.com/kasparsj/simple_form_language_input"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.14"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "rspec", "~> 3.0"
27
+ spec.add_development_dependency "rspec-rails", "~> 3.5"
28
+ spec.add_development_dependency 'pry', '~> 0'
29
+ spec.add_development_dependency 'pry-nav'
30
+
31
+ spec.add_dependency "simple_form"
32
+ spec.add_dependency "rails_language_select"
33
+ end
metadata ADDED
@@ -0,0 +1,167 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simple_form_language_input
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Kaspars
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-02-25 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.14'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.5'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry-nav
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'
97
+ - !ruby/object:Gem::Dependency
98
+ name: simple_form
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rails_language_select
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: Simple Form language input
126
+ email:
127
+ - kasparsj@gmail.com
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".gitignore"
133
+ - ".rspec"
134
+ - ".travis.yml"
135
+ - Gemfile
136
+ - Gemfile.lock
137
+ - MIT-LICENSE.txt
138
+ - README.md
139
+ - Rakefile
140
+ - lib/simple_form_language_input.rb
141
+ - lib/simple_form_language_input/version.rb
142
+ - simple_form_language_input.gemspec
143
+ homepage: https://github.com/kasparsj/simple_form_language_input
144
+ licenses:
145
+ - MIT
146
+ metadata: {}
147
+ post_install_message:
148
+ rdoc_options: []
149
+ require_paths:
150
+ - lib
151
+ required_ruby_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ requirements: []
162
+ rubyforge_project:
163
+ rubygems_version: 2.5.1
164
+ signing_key:
165
+ specification_version: 4
166
+ summary: Simple Form language input
167
+ test_files: []