klaro-client 0.4.1 → 0.4.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
  SHA256:
3
- metadata.gz: 70c91c551e54107e6eda147c489394ec1a4f57e459f2430b8734bc0fa068e7bf
4
- data.tar.gz: ede0ee43ff20ea21961cb45a6708e02a03dd02af7d6159b104188de61d3a4af3
3
+ metadata.gz: 54667fabd1bba720bee0b48f06b3b458848d4a6c89fc2a0555885fa6212dca97
4
+ data.tar.gz: e0d420d06f919d06a33ed4ab4320bb694a44000f938e084027c215b232a9f6a7
5
5
  SHA512:
6
- metadata.gz: c81fa1dd92a408d97260e583887ec5df9a9ca16a251772bc45a3a92213dd592e9c7638c1a458dafa870eb70d1d23c7e62a06e09ae12a2c4c5586955306ffd3b0
7
- data.tar.gz: f9e6fd2c2a5c7a1d0c6aa4f596d5961d419e453d2c5d32a60c74d5adb997b63bc384f621c81c8f9d71ef6291ea31e1c925c863c464f29c16ce5c7c8c7db52ca3
6
+ metadata.gz: 7eae47d9090069b8e31e1bd727572efe05573ad60f01bc18ee69658b493c91b5f399b807789ca5fd9b1982aba2e467a69dbbf5f94ff49000d228fc91cf46c2c8
7
+ data.tar.gz: 106659a3ca72d394e31b1fa6e56e7d60b807f9e95d3e58147f9d963d30d178efe3afc0934ebc82f13f13efbc2756961791de87845bcf0e480944efcede357ed0
@@ -15,6 +15,14 @@ module Klaro
15
15
  end
16
16
  alias :details :specification
17
17
 
18
+ def to_url(with_identifier = true)
19
+ I18n.config.available_locales = [:en, :fr]
20
+ url = I18n.transliterate(title.to_s)
21
+ url = url.downcase.gsub(/[^\w]+/,"-").gsub(/^[-]+|[-]+$/,"")
22
+ url = "#{self.identifier}-#{url}" if with_identifier
23
+ url
24
+ end
25
+
18
26
  def download_and_relocate_attachments(root_path, target_folder, client)
19
27
  as = self.attachments.map do |attachment|
20
28
  url = attachment["url"]
@@ -3,7 +3,7 @@ module Klaro
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 4
6
- TINY = 1
6
+ TINY = 2
7
7
  end
8
8
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
9
9
  end # class Client
data/lib/klaro/client.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'http'
2
2
  require 'path'
3
3
  require 'redcarpet'
4
+ require 'i18n'
4
5
 
5
6
  module Klaro
6
7
  class Client
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klaro-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - enspirit
@@ -58,6 +58,20 @@ dependencies:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '3.4'
61
+ - !ruby/object:Gem::Dependency
62
+ name: i18n
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '1.8'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '1.8'
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: path
63
77
  requirement: !ruby/object:Gem::Requirement