mno-enterprise-frontend 3.3.0 → 3.3.1

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: af6efb9bdfdd9c39e7aefb3216b184ce8179be47
4
- data.tar.gz: 5ef22d205228e9dd8187c58ad1de3720aecef2aa
3
+ metadata.gz: b627be5a83f12bb9b6e6bfcde051fd49aee4b356
4
+ data.tar.gz: f7eed0fe69d2f9e2a1b2cf4bd0d4a730eabda616
5
5
  SHA512:
6
- metadata.gz: 2e158e4d57556afa398c90fa7ff4cd522981a232010539a61d2d1589a9000f4fa4e689e06e4a25a65333d840f65e0cc78ca5ae48777742e178705477f3dfa6d5
7
- data.tar.gz: e551eddd77a2851d26cc555d12ae9bcb85df8c563cb4405b9e8d944450b590be15cda903821de6755abf531ec643612d18b8e4ee4300afd8a333e478c5d6a6a2
6
+ metadata.gz: 4c8687b06fd8540a147e446b5dab543ea4aca73442c367b40c021609ca6732231a73a857a98730c7e3a534f44dfc33f50a097b22c025562168f6516701384c99
7
+ data.tar.gz: 988cec782af69a201537ba098cda940b9348325144a29bc33d584e8dcb04305b24241f3154f1047c695a54bfa9a4159a1cba994aff0a7acfa7da77ebf247e994
@@ -20,14 +20,18 @@ namespace :mnoe do
20
20
  desc "Copy impac locales to the public locales folder"
21
21
  task :impac do
22
22
  locales_impac_folder = 'tmp/build/frontend/bower_components/impac-angular/dist/locales'
23
- cp_r("#{locales_impac_folder}/.","#{locales_dist_folder}/impac/")
24
23
 
25
- # TODO: remove when locales moved to four letters
26
- # 4-letters locales --> 2-letters locales
27
- dir = "#{locales_dist_folder}/impac/"
28
- Dir.foreach(dir) do |f|
29
- next unless f.include?(".json")
30
- File.rename("#{dir}#{f}", "#{dir}#{f.slice(0,2)}.json")
24
+ # impac-angular < 1.5.0-rc8 doesn't contain locales
25
+ if Dir.exists?(locales_impac_folder)
26
+ cp_r("#{locales_impac_folder}/.","#{locales_dist_folder}/impac/")
27
+
28
+ # TODO: remove when locales moved to four letters
29
+ # 4-letters locales --> 2-letters locales
30
+ dir = "#{locales_dist_folder}/impac/"
31
+ Dir.foreach(dir) do |f|
32
+ next unless f.include?(".json")
33
+ File.rename("#{dir}#{f}", "#{dir}#{f.slice(0,2)}.json")
34
+ end
31
35
  end
32
36
  end
33
37
  end
@@ -45,20 +45,35 @@ describe 'mnoe:locales:impac' do
45
45
  allow(Dir).to receive(:foreach) { [] }
46
46
  end
47
47
 
48
- it 'copies the locales to the public folder' do
49
- expect_any_instance_of(Rake::FileUtilsExt).to receive(:cp_r).with(
50
- 'tmp/build/frontend/bower_components/impac-angular/dist/locales/.',
51
- 'public/dashboard/locales/impac/'
52
- )
53
- subject.invoke
48
+ let(:impac_locales_path) { 'tmp/build/frontend/bower_components/impac-angular/dist/locales' }
49
+
50
+ context 'when the impac locales folder does not exist' do
51
+ before { allow(Dir).to receive(:exists?).with(impac_locales_path) { false } }
52
+
53
+ it 'does not copy the locales' do
54
+ expect_any_instance_of(Rake::FileUtilsExt).not_to receive(:cp_r)
55
+ expect(File).not_to receive(:rename)
56
+ subject.invoke
57
+ end
54
58
  end
55
59
 
56
- it 'transform 4 letters locales to 2 letters locales' do
57
- allow(Dir).to receive(:foreach).and_yield('en-GB.json')
58
- expect(File).to receive(:rename).with(
59
- 'public/dashboard/locales/impac/en-GB.json',
60
- 'public/dashboard/locales/impac/en.json'
61
- )
62
- subject.invoke
60
+ context 'when the impac locales folder exists' do
61
+ before { allow(Dir).to receive(:exists?).with(impac_locales_path) { true } }
62
+ it 'copies the locales to the public folder' do
63
+ expect_any_instance_of(Rake::FileUtilsExt).to receive(:cp_r).with(
64
+ 'tmp/build/frontend/bower_components/impac-angular/dist/locales/.',
65
+ 'public/dashboard/locales/impac/'
66
+ )
67
+ subject.invoke
68
+ end
69
+
70
+ it 'transform 4 letters locales to 2 letters locales' do
71
+ allow(Dir).to receive(:foreach).and_yield('en-GB.json')
72
+ expect(File).to receive(:rename).with(
73
+ 'public/dashboard/locales/impac/en-GB.json',
74
+ 'public/dashboard/locales/impac/en.json'
75
+ )
76
+ subject.invoke
77
+ end
63
78
  end
64
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mno-enterprise-frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Lachaume
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-20 00:00:00.000000000 Z
12
+ date: 2017-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mno-enterprise-core
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 3.3.0
20
+ version: 3.3.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 3.3.0
27
+ version: 3.3.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: mno-enterprise-api
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 3.3.0
34
+ version: 3.3.1
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 3.3.0
41
+ version: 3.3.1
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: less-rails
44
44
  requirement: !ruby/object:Gem::Requirement