flip_the_switch 1.0.2 → 1.0.3
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/.travis.yml +2 -1
- data/CHANGELOG.md +4 -0
- data/Example/Features.plist +1 -1
- data/FlipTheSwitch.podspec +1 -1
- data/Gemfile +1 -1
- data/flip_the_switch.gemspec +1 -1
- data/lib/flip_the_switch/cli.rb +1 -1
- data/lib/flip_the_switch/generator/settings.rb +5 -1
- data/spec/flip_the_switch/reader/features_spec.rb +3 -3
- data/spec/resources/ExpectedFeatures.plist +1 -1
- data/spec/resources/ExpectedSettingsBaseRoot.plist +1 -1
- data/spec/resources/ExpectedSettingsFeatures.plist +3 -3
- data/spec/resources/ExpectedSettingsMergeExistingRoot.plist +1 -1
- data/spec/resources/real/features.json +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0663cc5c7460abee71d86a8b0b8976352a2efeb
|
4
|
+
data.tar.gz: 40f1f4a3177c56f92211c94c76cc1a97d21e9496
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dd22507c1dde8495f43c6888d261295a49a10956e40d5b037735d010f6fe52ac9310b34be1d4e463d9a968f1ce3f9c468eb01928ea95cf3cc05f1fb06999eb3
|
7
|
+
data.tar.gz: 2a211aa6cf41da80bf08060e1082159561a2abfa3f91d3f4aa4fc1f596dc85ef22a96b4fc4a6758d9f2b63650eef29271c335704ad2419a067a4119573f967fb
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Example/Features.plist
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
3
|
<plist version="1.0">
|
4
4
|
<dict>
|
5
5
|
<key>features_controller</key>
|
data/FlipTheSwitch.podspec
CHANGED
data/Gemfile
CHANGED
data/flip_the_switch.gemspec
CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.email = %w(mg.england@gmail.com rob@robsiwek.com)
|
5
5
|
s.summary = 'A simple library to help enabling/disabling features on iOS/Mac applications.'
|
6
6
|
s.homepage = 'https://github.com/michaelengland/FlipTheSwitch'
|
7
|
-
s.version = '1.0.
|
7
|
+
s.version = '1.0.3'
|
8
8
|
s.license = 'MIT'
|
9
9
|
|
10
10
|
s.add_dependency 'thor', '~> 0.19'
|
data/lib/flip_the_switch/cli.rb
CHANGED
@@ -27,7 +27,7 @@ module FlipTheSwitch
|
|
27
27
|
end
|
28
28
|
|
29
29
|
desc 'settings', 'Auto-generates settings.bundle files for enabling/disabling features from iOS settings menu'
|
30
|
-
method_option :output, type: :string, aliases: '-o', default: defaults['settings_output'], desc: 'Location of the directory in which
|
30
|
+
method_option :output, type: :string, aliases: '-o', default: defaults['settings_output'], desc: 'Location of the directory in which the Settings.bundle will be modified'
|
31
31
|
|
32
32
|
def settings
|
33
33
|
settings_generator.generate
|
@@ -89,13 +89,17 @@ module FlipTheSwitch
|
|
89
89
|
features.map { |feature|
|
90
90
|
{
|
91
91
|
'Type' => 'PSToggleSwitchSpecifier',
|
92
|
-
'Title' => feature
|
92
|
+
'Title' => feature_title(feature),
|
93
93
|
'Key' => "FTS_FEATURE_#{feature.name}",
|
94
94
|
'DefaultValue' => feature.enabled
|
95
95
|
}
|
96
96
|
}
|
97
97
|
end
|
98
98
|
|
99
|
+
def feature_title(feature)
|
100
|
+
feature.name.gsub('_', ' ').capitalize
|
101
|
+
end
|
102
|
+
|
99
103
|
def current_plist
|
100
104
|
@current_plist ||= if File.exists?(root_plist)
|
101
105
|
::Plist::parse_xml(root_plist)
|
@@ -14,7 +14,7 @@ describe FlipTheSwitch::Reader::Features do
|
|
14
14
|
FlipTheSwitch::Feature.new('sub_sub_feature', false, nil, [], 'sub_feature')
|
15
15
|
], 'enabled_feature')
|
16
16
|
]),
|
17
|
-
FlipTheSwitch::Feature.new('disabled_feature', false)
|
17
|
+
FlipTheSwitch::Feature.new('disabled_feature', false, 'This feature is disabled')
|
18
18
|
])
|
19
19
|
end
|
20
20
|
end
|
@@ -30,7 +30,7 @@ describe FlipTheSwitch::Reader::Features do
|
|
30
30
|
FlipTheSwitch::Feature.new('sub_sub_feature', false, nil, [], 'sub_feature')
|
31
31
|
], 'enabled_feature')
|
32
32
|
]),
|
33
|
-
FlipTheSwitch::Feature.new('disabled_feature', false)
|
33
|
+
FlipTheSwitch::Feature.new('disabled_feature', false, 'This feature is disabled')
|
34
34
|
])
|
35
35
|
end
|
36
36
|
end
|
@@ -45,7 +45,7 @@ describe FlipTheSwitch::Reader::Features do
|
|
45
45
|
FlipTheSwitch::Feature.new('sub_sub_feature', false, nil, [], 'sub_feature')
|
46
46
|
], 'enabled_feature')
|
47
47
|
]),
|
48
|
-
FlipTheSwitch::Feature.new('disabled_feature', false)
|
48
|
+
FlipTheSwitch::Feature.new('disabled_feature', false, 'This feature is disabled')
|
49
49
|
])
|
50
50
|
end
|
51
51
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
3
|
<plist version="1.0">
|
4
4
|
<dict>
|
5
5
|
<key>disabled_feature</key>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
3
|
<plist version="1.0">
|
4
4
|
<dict>
|
5
5
|
<key>PreferenceSpecifiers</key>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
3
|
<plist version="1.0">
|
4
4
|
<dict>
|
5
5
|
<key>PreferenceSpecifiers</key>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<key>Key</key>
|
11
11
|
<string>FTS_FEATURE_first_feature</string>
|
12
12
|
<key>Title</key>
|
13
|
-
<string>
|
13
|
+
<string>First feature</string>
|
14
14
|
<key>Type</key>
|
15
15
|
<string>PSToggleSwitchSpecifier</string>
|
16
16
|
</dict>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<key>Key</key>
|
21
21
|
<string>FTS_FEATURE_second_feature</string>
|
22
22
|
<key>Title</key>
|
23
|
-
<string>
|
23
|
+
<string>Second feature</string>
|
24
24
|
<key>Type</key>
|
25
25
|
<string>PSToggleSwitchSpecifier</string>
|
26
26
|
</dict>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
3
|
<plist version="1.0">
|
4
4
|
<dict>
|
5
5
|
<key>PreferenceSpecifiers</key>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flip_the_switch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael England
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
198
|
version: '0'
|
199
199
|
requirements: []
|
200
200
|
rubyforge_project:
|
201
|
-
rubygems_version: 2.
|
201
|
+
rubygems_version: 2.5.1
|
202
202
|
signing_key:
|
203
203
|
specification_version: 4
|
204
204
|
summary: A simple library to help enabling/disabling features on iOS/Mac applications.
|