kabal 0.1.3 → 0.1.4

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: 8c20540f012d04c0f365c55626f1864c9c633c7a
4
- data.tar.gz: de31917cc938b3e6c8bc8851639604a3ba77bf52
3
+ metadata.gz: 33439037203abe61216a142cac5d9c02d06c238a
4
+ data.tar.gz: 7d5f04457e6e752f39a7e5fdb4dc6b5f11a1046a
5
5
  SHA512:
6
- metadata.gz: 98038c6116b3d7c8a05b252220a4ccaef8c0cef0a874e849ee3be79688e5310fe146e132cd3bda0b89313680ccbadb49d2e7e01b8e837ebedd2dea08fc02b161
7
- data.tar.gz: 9876b459c62d41804d39e9de8d07f53036bdff9bc62e511c00ad983728561b7906b33e37e4b37c99a1eb34e73da53659d1b5934649f8b3c4fc88955b3f26cecb
6
+ metadata.gz: 74532cb19862e75ac0b1526d18a00176b23a62d42f6941f176375413edce92f4f287a8c1758f9f5d8453579e73c66e4616a91863d2fbac1a669b317a087eed2e
7
+ data.tar.gz: ca456203cb903d8b62bc9c00a5e78400989ec92801860421a59f54a850e879b25b8edb61bcca204eb304a7f2071e2c1db913f793ec705aaa3651c8f870cae08a
data/kabal.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = ""
14
14
  spec.license = "MIT"
15
15
 
16
- spec.files = `git ls-files -z`.split("\x0")
16
+ spec.files = `git ls-files`.split("\n")
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
@@ -0,0 +1,9 @@
1
+ class Kabal::Config::YamlLoader
2
+ def self.gem_root
3
+ Gem::Specification.find_by_name("kabal").gem_dir
4
+ end
5
+
6
+ def self.yaml_object(filename)
7
+ yaml_obj = YAML.load_file(gem_root + "/yaml/" + filename + ".yml")
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module Kabal::Config
2
+ require "kabal/config/yaml_loader.rb"
3
+ end
@@ -1,12 +1,12 @@
1
1
  module Kabal
2
2
  class Language
3
3
  def lang
4
- languages = YAML.load_file('yaml/languages.yml')
4
+ languages = YamlLoader.yaml_object "languages"
5
5
  @lang = languages[self.to_s.split(":")[-2]]
6
6
  end
7
7
 
8
8
  def names
9
- YAML.load_file("yaml/languages/#{lang}.yml")
9
+ YamlLoader.yaml_object "languages/#{lang}"
10
10
  end
11
11
  end
12
12
  end
@@ -1,5 +1,6 @@
1
1
  class Declinations
2
2
  def self.name_with_declination(ten_power_name, count)
3
+ #FIXME add gem russian
3
4
  if ten_power_name[-1, 1] == "а"
4
5
  return ten_power_name if ends_with_one? count
5
6
  return ten_power_name[0..4] + "и" if end_with_two_or_three_of_four? count
data/lib/kabal/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kabal
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/kabal.rb CHANGED
@@ -1,11 +1,13 @@
1
1
  autoload :Version, "kabal/version"
2
2
  require "kabal/supported_languages"
3
3
  require "kabal/errors"
4
+ require "kabal/config"
4
5
  require 'yaml'
5
6
 
6
7
  module Kabal
7
8
  include SupportedLanguages
8
9
  include Errors
10
+ include Config
9
11
 
10
12
  def to_text(number)
11
13
  @language ||= "Russian"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kabal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-01 00:00:00.000000000 Z
11
+ date: 2014-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,6 +54,8 @@ files:
54
54
  - Rakefile
55
55
  - kabal.gemspec
56
56
  - lib/kabal.rb
57
+ - lib/kabal/config.rb
58
+ - lib/kabal/config/yaml_loader.rb
57
59
  - lib/kabal/errors.rb
58
60
  - lib/kabal/errors/no_language_support_error.rb
59
61
  - lib/kabal/errors/number_out_range_error.rb