okei 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +61 -0
- data/CHANGELOG.rdoc +13 -0
- data/LICENSE.rdoc +21 -0
- data/README.rdoc +91 -0
- data/Rakefile +52 -0
- data/app/controllers/okei/api/v1/responder.rb +30 -0
- data/app/controllers/okei/api/v1/units_controller.rb +41 -0
- data/app/models/okei/line.rb +63 -0
- data/app/models/okei/unit.rb +17 -0
- data/app/models/okei/word.rb +26 -0
- data/app/models/okei/words.rb +40 -0
- data/app/use_cases/okei/find_unit.rb +65 -0
- data/app/use_cases/okei/get_unit.rb +50 -0
- data/app/use_cases/okei/get_units.rb +45 -0
- data/app/views/okei/api/v1/units/_unit.json.jbuilder +6 -0
- data/app/views/okei/api/v1/units/errors.json.jbuilder +5 -0
- data/app/views/okei/api/v1/units/index.json.jbuilder +5 -0
- data/app/views/okei/api/v1/units/show.json.jbuilder +3 -0
- data/config/locales/ru.yml +12 -0
- data/config/routes.rb +12 -0
- data/db/migrate/20141004212500_create_okei_units.rb +20 -0
- data/db/migrate/20141004212501_populate_okei_units.rb +14 -0
- data/db/migrate/20141004212502_create_okei_words.rb +11 -0
- data/db/migrate/20141004212503_populate_okei_words.rb +15 -0
- data/db/seeds/units.json +4534 -0
- data/db/seeds/words.json +2462 -0
- data/lib/okei.rb +7 -0
- data/lib/okei/engine.rb +12 -0
- data/lib/okei/version.rb +4 -0
- data/lib/tasks/okei_tasks.rake +56 -0
- data/spec/controllers/okei/api/v1/responder_spec.rb +69 -0
- data/spec/controllers/okei/api/v1/units_controller_spec.rb +88 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +13 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +29 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +78 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/schema.rb +39 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +49831 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/examples/json_schemas/error.json +14 -0
- data/spec/examples/json_schemas/get_errors.json +18 -0
- data/spec/examples/json_schemas/get_unit.json +13 -0
- data/spec/examples/json_schemas/get_units.json +17 -0
- data/spec/examples/json_schemas/unit.json +20 -0
- data/spec/factories/units.rb +18 -0
- data/spec/factories/words.rb +7 -0
- data/spec/models/okei/line_spec.rb +61 -0
- data/spec/models/okei/unit_spec.rb +170 -0
- data/spec/models/okei/word_spec.rb +75 -0
- data/spec/models/okei/words_spec.rb +64 -0
- data/spec/requests/okei/api/v1/find_unit_spec.rb +65 -0
- data/spec/requests/okei/api/v1/get_unit_spec.rb +57 -0
- data/spec/requests/okei/api/v1/get_units_spec.rb +64 -0
- data/spec/routing/okei/api/v1/units_routing_spec.rb +56 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/support/initializers/caching.rb +20 -0
- data/spec/support/initializers/coveralls.rb +4 -0
- data/spec/support/initializers/database_cleaner.rb +24 -0
- data/spec/support/initializers/factory_girl.rb +6 -0
- data/spec/support/initializers/factory_girl_rails.rb +1 -0
- data/spec/support/initializers/focus.rb +5 -0
- data/spec/support/initializers/garbage_collection.rb +11 -0
- data/spec/support/initializers/i18n.rb +1 -0
- data/spec/support/initializers/migrations.rb +3 -0
- data/spec/support/initializers/rails.rb +6 -0
- data/spec/support/initializers/random_order.rb +4 -0
- data/spec/support/initializers/rspec.rb +10 -0
- data/spec/support/initializers/timecop.rb +1 -0
- data/spec/support/matchers/controllers.rb +14 -0
- data/spec/support/matchers/json_schema.rb +10 -0
- data/spec/use_cases/okei/find_unit_spec.rb +77 -0
- data/spec/use_cases/okei/get_unit_spec.rb +64 -0
- data/spec/use_cases/okei/get_units_spec.rb +65 -0
- data/spec/views/okei/api/v1/units/_unit.json_spec.rb +24 -0
- metadata +400 -0
@@ -0,0 +1 @@
|
|
1
|
+
require "factory_girl_rails"
|
@@ -0,0 +1 @@
|
|
1
|
+
I18n.enforce_available_locales = false
|
@@ -0,0 +1 @@
|
|
1
|
+
require "timecop"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Common matchers for controller specs
|
2
|
+
|
3
|
+
RSpec::Matchers.define :listen_to do |use_case|
|
4
|
+
match do |listener|
|
5
|
+
expect(use_case).to receive(:subscribe).with(listener, prefix: :on).once
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
RSpec::Matchers.define :run_after_subscriptions do
|
10
|
+
match do |use_case|
|
11
|
+
expect(use_case).to receive(:subscribe).ordered
|
12
|
+
expect(use_case).to receive(:run).once.ordered
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Matchers to check a json schema
|
2
|
+
require "json-schema"
|
3
|
+
|
4
|
+
RSpec::Matchers.define :match_json_schema do |schema|
|
5
|
+
match do |response|
|
6
|
+
schema_directory = "#{Dir.pwd}/spec/examples/json_schemas"
|
7
|
+
schema_path = "#{schema_directory}/#{schema}.json"
|
8
|
+
JSON::Validator.validate!(schema_path, response, strict: true)
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
module Okei
|
5
|
+
describe FindUnit do
|
6
|
+
|
7
|
+
# ==========================================================================
|
8
|
+
# Prepare context
|
9
|
+
# ==========================================================================
|
10
|
+
|
11
|
+
let!(:unit) { create :unit, code: "ТЫС ЧЕЛ-ЧАС" }
|
12
|
+
before do
|
13
|
+
{
|
14
|
+
"1000" => "ТЫС",
|
15
|
+
"ЧЕЛОВЕКО" => "ЧЕЛ",
|
16
|
+
"ЧАСОВ" => "ЧАС",
|
17
|
+
"ТЫС ЧЕЛ ЧАС" => "ТЫС ЧЕЛ-ЧАС"
|
18
|
+
}.each { |synonym, text| create :word, synonym: synonym, text: text }
|
19
|
+
end
|
20
|
+
|
21
|
+
# ==========================================================================
|
22
|
+
# Prepare variables
|
23
|
+
# ==========================================================================
|
24
|
+
|
25
|
+
let(:listener) { double "listener" }
|
26
|
+
|
27
|
+
def prepare_case(text)
|
28
|
+
use_case = FindUnit.new text: text
|
29
|
+
use_case.subscribe(listener)
|
30
|
+
use_case
|
31
|
+
end
|
32
|
+
|
33
|
+
# ==========================================================================
|
34
|
+
# Run tests
|
35
|
+
# ==========================================================================
|
36
|
+
|
37
|
+
describe "#run" do
|
38
|
+
|
39
|
+
context "with proper text" do
|
40
|
+
|
41
|
+
let!(:text) { "1000 человеко-часов" }
|
42
|
+
subject(:use_case) { prepare_case text }
|
43
|
+
|
44
|
+
it "returns the unit" do
|
45
|
+
expect(use_case.run).to eq unit
|
46
|
+
end
|
47
|
+
|
48
|
+
it "sends 'found' to subscribers" do
|
49
|
+
expect(listener).to receive(:found).with(unit)
|
50
|
+
use_case.run
|
51
|
+
end
|
52
|
+
|
53
|
+
it "caches results of code preparing", :caching do
|
54
|
+
use_case.run
|
55
|
+
expect(Word).not_to receive(:find_by_synonym)
|
56
|
+
prepare_case(text).run
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
context "with wrong text" do
|
61
|
+
|
62
|
+
subject(:use_case) { prepare_case "тысяч человеко-часов" }
|
63
|
+
|
64
|
+
it "returns nil" do
|
65
|
+
expect(use_case.run).to be_nil
|
66
|
+
end
|
67
|
+
|
68
|
+
it "sends 'not_found' to subscribers" do
|
69
|
+
expect(listener).to receive :not_found do |messages|
|
70
|
+
expect(messages).not_to be_blank
|
71
|
+
end
|
72
|
+
use_case.run
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
module Okei
|
5
|
+
describe GetUnit do
|
6
|
+
|
7
|
+
# ==========================================================================
|
8
|
+
# Prepare context
|
9
|
+
# ==========================================================================
|
10
|
+
|
11
|
+
let!(:unit) { create :unit }
|
12
|
+
|
13
|
+
# ==========================================================================
|
14
|
+
# Prepare variables
|
15
|
+
# ==========================================================================
|
16
|
+
|
17
|
+
let!(:params) { { uuid: unit.uuid } }
|
18
|
+
let(:listener) { double "listener" }
|
19
|
+
|
20
|
+
def prepare_case(params)
|
21
|
+
use_case = GetUnit.new params
|
22
|
+
use_case.subscribe(listener)
|
23
|
+
use_case
|
24
|
+
end
|
25
|
+
|
26
|
+
# ==========================================================================
|
27
|
+
# Run tests
|
28
|
+
# ==========================================================================
|
29
|
+
|
30
|
+
describe "#run" do
|
31
|
+
|
32
|
+
context "with proper uuid" do
|
33
|
+
|
34
|
+
subject(:use_case) { prepare_case params }
|
35
|
+
|
36
|
+
it "returns unit" do
|
37
|
+
expect(use_case.run).to eq unit
|
38
|
+
end
|
39
|
+
|
40
|
+
it "sends 'found' to subscribers" do
|
41
|
+
expect(listener).to receive(:found).with(unit)
|
42
|
+
use_case.run
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context "with wrong uuid" do
|
47
|
+
|
48
|
+
before { params[:uuid] = "wrong" }
|
49
|
+
subject(:use_case) { prepare_case params }
|
50
|
+
|
51
|
+
it "returns nil" do
|
52
|
+
expect(use_case.run).to be_nil
|
53
|
+
end
|
54
|
+
|
55
|
+
it "sends 'not_found' to subscribers" do
|
56
|
+
expect(listener).to receive :not_found do |messages|
|
57
|
+
expect(messages).not_to be_blank
|
58
|
+
end
|
59
|
+
use_case.run
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
module Okei
|
5
|
+
describe GetUnits do
|
6
|
+
|
7
|
+
# ==========================================================================
|
8
|
+
# Prepare context
|
9
|
+
# ==========================================================================
|
10
|
+
|
11
|
+
let!(:nmile) { create :unit, measure: "ДЛИНА" }
|
12
|
+
let!(:mole) { create :unit, measure: "ПРОЧИЕ" }
|
13
|
+
|
14
|
+
# ==========================================================================
|
15
|
+
# Prepare variables
|
16
|
+
# ==========================================================================
|
17
|
+
|
18
|
+
let(:listener) { double "listener" }
|
19
|
+
|
20
|
+
def prepare_case(params = {})
|
21
|
+
use_case = GetUnits.new params
|
22
|
+
use_case.subscribe(listener)
|
23
|
+
use_case
|
24
|
+
end
|
25
|
+
|
26
|
+
# ==========================================================================
|
27
|
+
# Run tests
|
28
|
+
# ==========================================================================
|
29
|
+
|
30
|
+
describe "#run" do
|
31
|
+
|
32
|
+
context "without params" do
|
33
|
+
|
34
|
+
subject(:use_case) { prepare_case }
|
35
|
+
|
36
|
+
it "returns all units" do
|
37
|
+
expect(use_case.run.to_a).to eq Unit.all.order(:code).to_a
|
38
|
+
end
|
39
|
+
|
40
|
+
it "sends 'success' to subscribers" do
|
41
|
+
expect(listener).to receive(:success) do |units|
|
42
|
+
expect(units.to_a).to eq Unit.all.order(:code).to_a
|
43
|
+
end
|
44
|
+
use_case.run
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
context "with some measure" do
|
49
|
+
|
50
|
+
subject(:use_case) { prepare_case "measure" => "ДЛИНА" }
|
51
|
+
|
52
|
+
it "returns matched units" do
|
53
|
+
expect(use_case.run.to_a).to eq [nmile]
|
54
|
+
end
|
55
|
+
|
56
|
+
it "sends 'success' to subscribers" do
|
57
|
+
expect(listener).to receive(:success) do |units|
|
58
|
+
expect(units.to_a).to eq [nmile]
|
59
|
+
end
|
60
|
+
use_case.run
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
module Okei
|
5
|
+
module Api
|
6
|
+
module V1
|
7
|
+
|
8
|
+
describe "_unit.json", caching: true do
|
9
|
+
|
10
|
+
def render_page_with(unit)
|
11
|
+
render partial: "okei/api/v1/units/unit.json", locals: { unit: unit }
|
12
|
+
end
|
13
|
+
|
14
|
+
let!(:unit) { create :unit }
|
15
|
+
before { render_page_with unit }
|
16
|
+
|
17
|
+
it "uses caching" do
|
18
|
+
expect(unit).not_to receive(:code)
|
19
|
+
render_page_with unit
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,400 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: okei
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrew Kozin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-10-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: hexx
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.0.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.0.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: jbuilder
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '2.2'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '2.2'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rails
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '4.1'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '4.1'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: database_cleaner
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '1.3'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.3'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: factory_girl_rails
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '4.4'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '4.4'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: inch
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.5'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0.5'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: json-schema
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '2.2'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '2.2'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: metric_fu
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '4.11'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '4.11'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: rspec-rails
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '3.1'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '3.1'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: rubocop
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0.26'
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0.26'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: sqlite3
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "~>"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '1.3'
|
166
|
+
type: :development
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - "~>"
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '1.3'
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
name: timecop
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - "~>"
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0.7'
|
180
|
+
type: :development
|
181
|
+
prerelease: false
|
182
|
+
version_requirements: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - "~>"
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0.7'
|
187
|
+
description: RESTful public JSON API for units of measures following Russian national
|
188
|
+
standard (OKEI).
|
189
|
+
email: andrew.kozin@gmail.com
|
190
|
+
executables: []
|
191
|
+
extensions: []
|
192
|
+
extra_rdoc_files:
|
193
|
+
- CHANGELOG.rdoc
|
194
|
+
- LICENSE.rdoc
|
195
|
+
- README.rdoc
|
196
|
+
files:
|
197
|
+
- ".rubocop.yml"
|
198
|
+
- CHANGELOG.rdoc
|
199
|
+
- LICENSE.rdoc
|
200
|
+
- README.rdoc
|
201
|
+
- Rakefile
|
202
|
+
- app/controllers/okei/api/v1/responder.rb
|
203
|
+
- app/controllers/okei/api/v1/units_controller.rb
|
204
|
+
- app/models/okei/line.rb
|
205
|
+
- app/models/okei/unit.rb
|
206
|
+
- app/models/okei/word.rb
|
207
|
+
- app/models/okei/words.rb
|
208
|
+
- app/use_cases/okei/find_unit.rb
|
209
|
+
- app/use_cases/okei/get_unit.rb
|
210
|
+
- app/use_cases/okei/get_units.rb
|
211
|
+
- app/views/okei/api/v1/units/_unit.json.jbuilder
|
212
|
+
- app/views/okei/api/v1/units/errors.json.jbuilder
|
213
|
+
- app/views/okei/api/v1/units/index.json.jbuilder
|
214
|
+
- app/views/okei/api/v1/units/show.json.jbuilder
|
215
|
+
- config/locales/ru.yml
|
216
|
+
- config/routes.rb
|
217
|
+
- db/migrate/20141004212500_create_okei_units.rb
|
218
|
+
- db/migrate/20141004212501_populate_okei_units.rb
|
219
|
+
- db/migrate/20141004212502_create_okei_words.rb
|
220
|
+
- db/migrate/20141004212503_populate_okei_words.rb
|
221
|
+
- db/seeds/units.json
|
222
|
+
- db/seeds/words.json
|
223
|
+
- lib/okei.rb
|
224
|
+
- lib/okei/engine.rb
|
225
|
+
- lib/okei/version.rb
|
226
|
+
- lib/tasks/okei_tasks.rake
|
227
|
+
- spec/controllers/okei/api/v1/responder_spec.rb
|
228
|
+
- spec/controllers/okei/api/v1/units_controller_spec.rb
|
229
|
+
- spec/dummy/README.rdoc
|
230
|
+
- spec/dummy/Rakefile
|
231
|
+
- spec/dummy/app/assets/javascripts/application.js
|
232
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
233
|
+
- spec/dummy/app/controllers/application_controller.rb
|
234
|
+
- spec/dummy/app/helpers/application_helper.rb
|
235
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
236
|
+
- spec/dummy/bin/bundle
|
237
|
+
- spec/dummy/bin/rails
|
238
|
+
- spec/dummy/bin/rake
|
239
|
+
- spec/dummy/config.ru
|
240
|
+
- spec/dummy/config/application.rb
|
241
|
+
- spec/dummy/config/boot.rb
|
242
|
+
- spec/dummy/config/database.yml
|
243
|
+
- spec/dummy/config/environment.rb
|
244
|
+
- spec/dummy/config/environments/development.rb
|
245
|
+
- spec/dummy/config/environments/production.rb
|
246
|
+
- spec/dummy/config/environments/test.rb
|
247
|
+
- spec/dummy/config/initializers/assets.rb
|
248
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
249
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
250
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
251
|
+
- spec/dummy/config/initializers/inflections.rb
|
252
|
+
- spec/dummy/config/initializers/mime_types.rb
|
253
|
+
- spec/dummy/config/initializers/session_store.rb
|
254
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
255
|
+
- spec/dummy/config/locales/en.yml
|
256
|
+
- spec/dummy/config/routes.rb
|
257
|
+
- spec/dummy/config/secrets.yml
|
258
|
+
- spec/dummy/db/schema.rb
|
259
|
+
- spec/dummy/db/test.sqlite3
|
260
|
+
- spec/dummy/log/test.log
|
261
|
+
- spec/dummy/public/404.html
|
262
|
+
- spec/dummy/public/422.html
|
263
|
+
- spec/dummy/public/500.html
|
264
|
+
- spec/dummy/public/favicon.ico
|
265
|
+
- spec/examples/json_schemas/error.json
|
266
|
+
- spec/examples/json_schemas/get_errors.json
|
267
|
+
- spec/examples/json_schemas/get_unit.json
|
268
|
+
- spec/examples/json_schemas/get_units.json
|
269
|
+
- spec/examples/json_schemas/unit.json
|
270
|
+
- spec/factories/units.rb
|
271
|
+
- spec/factories/words.rb
|
272
|
+
- spec/models/okei/line_spec.rb
|
273
|
+
- spec/models/okei/unit_spec.rb
|
274
|
+
- spec/models/okei/word_spec.rb
|
275
|
+
- spec/models/okei/words_spec.rb
|
276
|
+
- spec/requests/okei/api/v1/find_unit_spec.rb
|
277
|
+
- spec/requests/okei/api/v1/get_unit_spec.rb
|
278
|
+
- spec/requests/okei/api/v1/get_units_spec.rb
|
279
|
+
- spec/routing/okei/api/v1/units_routing_spec.rb
|
280
|
+
- spec/spec_helper.rb
|
281
|
+
- spec/support/initializers/caching.rb
|
282
|
+
- spec/support/initializers/coveralls.rb
|
283
|
+
- spec/support/initializers/database_cleaner.rb
|
284
|
+
- spec/support/initializers/factory_girl.rb
|
285
|
+
- spec/support/initializers/factory_girl_rails.rb
|
286
|
+
- spec/support/initializers/focus.rb
|
287
|
+
- spec/support/initializers/garbage_collection.rb
|
288
|
+
- spec/support/initializers/i18n.rb
|
289
|
+
- spec/support/initializers/migrations.rb
|
290
|
+
- spec/support/initializers/rails.rb
|
291
|
+
- spec/support/initializers/random_order.rb
|
292
|
+
- spec/support/initializers/rspec.rb
|
293
|
+
- spec/support/initializers/timecop.rb
|
294
|
+
- spec/support/matchers/controllers.rb
|
295
|
+
- spec/support/matchers/json_schema.rb
|
296
|
+
- spec/use_cases/okei/find_unit_spec.rb
|
297
|
+
- spec/use_cases/okei/get_unit_spec.rb
|
298
|
+
- spec/use_cases/okei/get_units_spec.rb
|
299
|
+
- spec/views/okei/api/v1/units/_unit.json_spec.rb
|
300
|
+
homepage: https://github.com/nepalez/okei
|
301
|
+
licenses:
|
302
|
+
- MIT
|
303
|
+
metadata: {}
|
304
|
+
post_install_message:
|
305
|
+
rdoc_options: []
|
306
|
+
require_paths:
|
307
|
+
- lib
|
308
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
309
|
+
requirements:
|
310
|
+
- - "~>"
|
311
|
+
- !ruby/object:Gem::Version
|
312
|
+
version: '2.1'
|
313
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
|
+
requirements:
|
315
|
+
- - ">="
|
316
|
+
- !ruby/object:Gem::Version
|
317
|
+
version: '0'
|
318
|
+
requirements: []
|
319
|
+
rubyforge_project:
|
320
|
+
rubygems_version: 2.2.2
|
321
|
+
signing_key:
|
322
|
+
specification_version: 4
|
323
|
+
summary: API for units of measure
|
324
|
+
test_files:
|
325
|
+
- spec/views/okei/api/v1/units/_unit.json_spec.rb
|
326
|
+
- spec/routing/okei/api/v1/units_routing_spec.rb
|
327
|
+
- spec/spec_helper.rb
|
328
|
+
- spec/models/okei/unit_spec.rb
|
329
|
+
- spec/models/okei/words_spec.rb
|
330
|
+
- spec/models/okei/word_spec.rb
|
331
|
+
- spec/models/okei/line_spec.rb
|
332
|
+
- spec/dummy/public/500.html
|
333
|
+
- spec/dummy/public/422.html
|
334
|
+
- spec/dummy/public/404.html
|
335
|
+
- spec/dummy/public/favicon.ico
|
336
|
+
- spec/dummy/config/secrets.yml
|
337
|
+
- spec/dummy/config/locales/en.yml
|
338
|
+
- spec/dummy/config/environments/test.rb
|
339
|
+
- spec/dummy/config/environments/development.rb
|
340
|
+
- spec/dummy/config/environments/production.rb
|
341
|
+
- spec/dummy/config/environment.rb
|
342
|
+
- spec/dummy/config/boot.rb
|
343
|
+
- spec/dummy/config/database.yml
|
344
|
+
- spec/dummy/config/routes.rb
|
345
|
+
- spec/dummy/config/application.rb
|
346
|
+
- spec/dummy/config/initializers/mime_types.rb
|
347
|
+
- spec/dummy/config/initializers/inflections.rb
|
348
|
+
- spec/dummy/config/initializers/session_store.rb
|
349
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
350
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
351
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
352
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
353
|
+
- spec/dummy/config/initializers/assets.rb
|
354
|
+
- spec/dummy/db/test.sqlite3
|
355
|
+
- spec/dummy/db/schema.rb
|
356
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
357
|
+
- spec/dummy/app/assets/javascripts/application.js
|
358
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
359
|
+
- spec/dummy/app/helpers/application_helper.rb
|
360
|
+
- spec/dummy/app/controllers/application_controller.rb
|
361
|
+
- spec/dummy/Rakefile
|
362
|
+
- spec/dummy/README.rdoc
|
363
|
+
- spec/dummy/log/test.log
|
364
|
+
- spec/dummy/config.ru
|
365
|
+
- spec/dummy/bin/rake
|
366
|
+
- spec/dummy/bin/rails
|
367
|
+
- spec/dummy/bin/bundle
|
368
|
+
- spec/factories/words.rb
|
369
|
+
- spec/factories/units.rb
|
370
|
+
- spec/controllers/okei/api/v1/responder_spec.rb
|
371
|
+
- spec/controllers/okei/api/v1/units_controller_spec.rb
|
372
|
+
- spec/examples/json_schemas/get_errors.json
|
373
|
+
- spec/examples/json_schemas/error.json
|
374
|
+
- spec/examples/json_schemas/get_unit.json
|
375
|
+
- spec/examples/json_schemas/get_units.json
|
376
|
+
- spec/examples/json_schemas/unit.json
|
377
|
+
- spec/use_cases/okei/get_unit_spec.rb
|
378
|
+
- spec/use_cases/okei/find_unit_spec.rb
|
379
|
+
- spec/use_cases/okei/get_units_spec.rb
|
380
|
+
- spec/support/matchers/json_schema.rb
|
381
|
+
- spec/support/matchers/controllers.rb
|
382
|
+
- spec/support/initializers/garbage_collection.rb
|
383
|
+
- spec/support/initializers/i18n.rb
|
384
|
+
- spec/support/initializers/factory_girl.rb
|
385
|
+
- spec/support/initializers/focus.rb
|
386
|
+
- spec/support/initializers/timecop.rb
|
387
|
+
- spec/support/initializers/factory_girl_rails.rb
|
388
|
+
- spec/support/initializers/coveralls.rb
|
389
|
+
- spec/support/initializers/database_cleaner.rb
|
390
|
+
- spec/support/initializers/migrations.rb
|
391
|
+
- spec/support/initializers/random_order.rb
|
392
|
+
- spec/support/initializers/rspec.rb
|
393
|
+
- spec/support/initializers/caching.rb
|
394
|
+
- spec/support/initializers/rails.rb
|
395
|
+
- spec/requests/okei/api/v1/get_unit_spec.rb
|
396
|
+
- spec/requests/okei/api/v1/find_unit_spec.rb
|
397
|
+
- spec/requests/okei/api/v1/get_units_spec.rb
|
398
|
+
- Rakefile
|
399
|
+
- ".rubocop.yml"
|
400
|
+
has_rdoc:
|