wor 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3a97cac4c47daa5b8066be8e72cfecb6b120179
4
- data.tar.gz: f8bf53bc4c0798c05e8ad543cf1922d994000321
3
+ metadata.gz: 51d36d05dcaab9fe8e0024a92c8cc5eff1f179c5
4
+ data.tar.gz: 62f708932066dba41c28acd4daf0502c09e8bf85
5
5
  SHA512:
6
- metadata.gz: 32ca962788a29ccb71eebe3afa297d82cce48e5962361172a657dc4fd4ddc52f4d0e87d3f9cb1edecd7c6c3cecc82b58cd3c702fbeb6e418eebe2950c5dbf79c
7
- data.tar.gz: 7a335f27b49f245fa256cf6198bfc3cf370c04c3a7212713e111f5d87ec431bd7f34f8a1885a6db0c86a77241e14d1e203bb1ae0bafc0319e3eb819a0a8204f9
6
+ metadata.gz: 322e02530c05b53a7f8fbadfb33f3b9cab70b8914a93629ba8a3ad13738dd83064d3df983447b50e37dd9b93118dc992c3c864dba3d45567244ee5fa19683dc3
7
+ data.tar.gz: 1dc8c11d6da49a44940462eea0c12a6e1ad36ac30193f4f26cf7b0918c8a75e1b0d03869558ff771bf28803715fbd46394e843a83dec9c795eb8cf8d3eb97ed6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wor (0.0.4)
4
+ wor (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/wor.rb CHANGED
@@ -20,7 +20,7 @@ module WOR
20
20
  else
21
21
  collection_name = params[:collection]
22
22
  translated_collection_name = WOR::Collection.get_folder_name(locale: params[:locale], collection_name: collection_name)
23
- path += "/#{params[:collection]}"
23
+ path += "/#{translated_collection_name}"
24
24
  end
25
25
 
26
26
  path += "/#{WOR::Localization.translate_path_to_original(path: params[:page_name], locale: params[:locale])}.md"
@@ -15,13 +15,15 @@ module WOR
15
15
  return params[:collection_name]
16
16
  end
17
17
 
18
+ collection_name = params[:collection_name]
19
+
18
20
  locale_info['paths'].each do | key, value |
19
21
  if (value == params[:collection_name].to_s)
20
- return key
22
+ collection_name = key
21
23
  end
22
24
  end
23
25
 
24
- return params[:collection_name]
26
+ return collection_name
25
27
  end
26
28
 
27
29
  def get_folder_name_by_path(params)
@@ -0,0 +1,4 @@
1
+ ---
2
+ title: Teste
3
+ ---
4
+ Content Here
@@ -9,20 +9,34 @@ describe WOR::Core do
9
9
  expect(target.permalink).not_to be(nil)
10
10
  end
11
11
 
12
- it 'find with basename' do
12
+ it 'find with language in pt language and have all translation' do
13
13
  params = { collection: "cursos", locale: "pt", page_name: "teste"}
14
14
  target = WOR::Core.find(params)
15
15
 
16
16
  expect(target).not_to be(nil)
17
17
  end
18
18
 
19
- it 'find with basename without item have permalink on language' do
19
+ it 'have correctly url in pt language and dont have page name translation' do
20
+ params = { collection: "cursos", locale: "pt", page_name: "course-test"}
21
+ target = WOR::Core.find(params)
22
+
23
+ expect(target.url).to eq("/pt/cursos/course-test")
24
+ end
25
+
26
+ it 'find with basename in default language' do
20
27
  params = { collection: "courses", locale: "en", page_name: "test" }
21
28
  target = WOR::Core.find(params)
22
29
 
23
30
  expect(target.permalink).not_to be(nil)
24
31
  end
25
32
 
33
+ it 'find with language in default language and dont have page name translation' do
34
+ params = { collection: "cursos", locale: "pt", page_name: "course-test"}
35
+ target = WOR::Core.find(params)
36
+
37
+ expect(target).not_to be(nil)
38
+ end
39
+
26
40
  it 'get url of root in default language' do
27
41
  params = { collection: "pages", locale: "en", page_name: "index" }
28
42
  target = WOR::Core.find(params)
@@ -50,6 +64,13 @@ describe WOR::Core do
50
64
 
51
65
  expect(target.url).to eq("/pt/cursos")
52
66
  end
67
+
68
+ it 'get existing collection' do
69
+ collection = WOR::Collection.new('Courses')
70
+
71
+ expect(collection).not_to be(nil)
72
+ end
73
+
53
74
  end
54
75
 
55
76
  describe WOR::Helpers do
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'wor'
3
- s.version = '0.0.5'
3
+ s.version = '0.0.6'
4
4
  s.date = '2017-05-07'
5
5
  s.summary = "To do summary!"
6
6
  s.description = "To do description"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Vargas
@@ -63,6 +63,7 @@ files:
63
63
  - spec/rails_app/config/environments/test.rb
64
64
  - spec/rails_app/config/locales/wor.en.yml
65
65
  - spec/rails_app/config/locales/wor.pt.yml
66
+ - spec/rails_app/content/courses/course-test.md
66
67
  - spec/rails_app/content/courses/test.md
67
68
  - spec/rails_app/content/pages/courses.md
68
69
  - spec/rails_app/content/pages/index.md