locabulary 0.2.0 → 0.3.0
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 +4 -4
- data/.hound.yml +46 -0
- data/.rspec +1 -0
- data/.rubocop_todo.yml +21 -0
- data/.ruby-version +1 -0
- data/Gemfile +3 -0
- data/README.md +8 -1
- data/Rakefile +37 -4
- data/data/administrative_units.json +374 -806
- data/lib/locabulary/exceptions.rb +25 -0
- data/lib/locabulary/items/administrative_unit.rb +65 -0
- data/lib/locabulary/items/base.rb +105 -0
- data/lib/locabulary/items.rb +32 -0
- data/lib/locabulary/json_creator.rb +105 -0
- data/lib/locabulary/schema.rb +11 -20
- data/lib/locabulary/version.rb +3 -0
- data/lib/locabulary.rb +67 -88
- data/locabulary.gemspec +8 -2
- data/script/update_data_files.sh +7 -2
- metadata +97 -4
- data/script/json_creator.rb +0 -129
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80199b69498270b4694e29cb3db82b69753f5fdc
|
4
|
+
data.tar.gz: 83d0db6b94721969a38108fb3a49174479a60495
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31460d7740cdec062a7b0375c76d0293fd3c5dc05ff955794dfdf06d9925c4b264f2b38eb227e363594805d26c5b31b31eabe08d0c6a5f43fce5e3485e2b6110
|
7
|
+
data.tar.gz: eb01d291687cb61ad41f7f8ee53745a34d1fdb519c9a1ef87b30b39e5ce8d6e81e524da1f7d6c43c67211a1351c64e108d256ec499f3ce0943c960264a54b51d
|
data/.hound.yml
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
################################################################################
|
4
|
+
## Releasing the hounds in your local environment.
|
5
|
+
##
|
6
|
+
## Setup:
|
7
|
+
## $ gem install rubocop
|
8
|
+
##
|
9
|
+
## Run:
|
10
|
+
## $ rubocop ./path/to/file ./or/path/to/directory -c ./.hound.yml
|
11
|
+
##
|
12
|
+
## Generation Notes:
|
13
|
+
## This file was generated via the commitment:install generator. You are free
|
14
|
+
## and expected to change this file.
|
15
|
+
################################################################################
|
16
|
+
AllCops:
|
17
|
+
Include:
|
18
|
+
- Rakefile
|
19
|
+
Exclude:
|
20
|
+
- 'vendor/**/*'
|
21
|
+
- 'tmp/**/*'
|
22
|
+
- 'bin/**/*'
|
23
|
+
- 'lib/milan/registry.rb'
|
24
|
+
TargetRubyVersion: 2.2
|
25
|
+
Rails:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
LineLength:
|
29
|
+
Description: 'Limit lines to 140 characters.'
|
30
|
+
Max: 140
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
Style/StringLiterals:
|
34
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
PercentLiteralDelimiters:
|
38
|
+
Description: 'Use `%`-literal delimiters consistently'
|
39
|
+
Enabled: false
|
40
|
+
|
41
|
+
Documentation:
|
42
|
+
Description: 'Document classes and non-namespace modules.'
|
43
|
+
Enabled: true
|
44
|
+
Exclude:
|
45
|
+
- spec/**/*
|
46
|
+
- test/**/*
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2016-02-23 14:57:16 -0500 using RuboCop version 0.37.2.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 2
|
10
|
+
Metrics/AbcSize:
|
11
|
+
Max: 33
|
12
|
+
|
13
|
+
# Offense count: 2
|
14
|
+
# Configuration parameters: CountComments.
|
15
|
+
Metrics/MethodLength:
|
16
|
+
Max: 20
|
17
|
+
|
18
|
+
# Offense count: 2
|
19
|
+
Style/IdenticalConditionalBranches:
|
20
|
+
Exclude:
|
21
|
+
- 'lib/locabulary.rb'
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.2.2
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Locabulary
|
2
2
|
|
3
|
+
[](https://travis-ci.org/ndlib/locabulary)
|
4
|
+
[](https://codeclimate.com/github/ndlib/locabulary)
|
5
|
+
[](https://codeclimate.com/github/ndlib/locabulary)
|
6
|
+
[](https://gemnasium.com/ndlib/locabulary)
|
7
|
+
[](http://inch-ci.org/github/ndlib/locabulary)
|
8
|
+
[](./LICENSE)
|
9
|
+
|
3
10
|
An extraction of limited localized vocabulary for Sipity and CurateND.
|
4
11
|
This controlled vocabulary has a limited shelf-life as we explore other more
|
5
|
-
robust options.
|
12
|
+
robust options.
|
data/Rakefile
CHANGED
@@ -1,9 +1,42 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
|
3
|
+
unless Rake::Task.task_defined?('spec')
|
4
|
+
begin
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
7
|
+
t.pattern = "./spec/**/*_spec.rb"
|
8
|
+
ENV['COVERAGE'] = 'true'
|
9
|
+
end
|
10
|
+
rescue LoadError
|
11
|
+
$stdout.puts "RSpec failed to load; You won't be able to run tests."
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'rubocop/rake_task'
|
16
|
+
RuboCop::RakeTask.new do |task|
|
17
|
+
task.options << "--config=.hound.yml"
|
18
|
+
end
|
4
19
|
|
5
|
-
|
6
|
-
|
20
|
+
namespace :commitment do
|
21
|
+
task :configure_test_for_code_coverage do
|
22
|
+
ENV['COVERAGE'] = 'true'
|
23
|
+
end
|
24
|
+
task :code_coverage do
|
25
|
+
require 'json'
|
26
|
+
$stdout.puts "Checking code_coverage"
|
27
|
+
lastrun_filename = File.expand_path('../coverage/.last_run.json', __FILE__)
|
28
|
+
if File.exist?(lastrun_filename)
|
29
|
+
coverage_percentage = JSON.parse(File.read(lastrun_filename)).fetch('result').fetch('covered_percent').to_i
|
30
|
+
if coverage_percentage < 100
|
31
|
+
abort("ERROR: Code Coverage Goal Not Met:\n\t#{coverage_percentage}%\tExpected\n\t100%\tActual")
|
32
|
+
else
|
33
|
+
$stdout.puts "Code Coverage Goal Met (100%)"
|
34
|
+
end
|
35
|
+
else
|
36
|
+
abort "Expected #{lastrun_filename} to exist for code coverage"
|
37
|
+
end
|
38
|
+
end
|
7
39
|
end
|
8
40
|
|
9
|
-
task(default: :
|
41
|
+
task(default: [:rubocop, 'commitment:configure_test_for_code_coverage', :spec, 'commitment:code_coverage'])
|
42
|
+
task(release: :default)
|