gena 0.1.1 → 0.1.2

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: 51d813b88b44bbcb481e7e910f4bd317eb07cf76
4
- data.tar.gz: ee01de046fb62ec208e9e58f5246247f9a4aab70
3
+ metadata.gz: 6a44fa4e81f553a8c076abdcb11b6adf253fedda
4
+ data.tar.gz: 0de9caec1fe88d65f58ce703ca19992e31b1b1a7
5
5
  SHA512:
6
- metadata.gz: b4b5cf34acc5337c977c6d8fb25c21bd8c41211c713d54978f4083c958a5888120abf715b89035da207813427e51ce8c18737f025c3840c727e70d7811d33371
7
- data.tar.gz: 724e32b7928e804d123839aaffb34078ef572eadeeb02fc422dc28532872819d4c488135316f9615c1ccf18cc022711a883a6fafd8c07af3c7474cca81aa225c
6
+ metadata.gz: 313387add045ed0b97595fe291ee003c022be9c752e70a51c0c5911a036b63b3f557fdefef914732352356535542970c67ca62046d78241fa5761995674f5c41
7
+ data.tar.gz: f613c2e97cb7ad580bb04729fc38cbabfc91781c84ee11fbcf8a096d930bfca649667567fd14493004a3c0ae2ce8503181f0359747dff34b0dc5f7cfab995ce3
data/lib/cli/cli.rb CHANGED
@@ -123,6 +123,9 @@ module Gena
123
123
 
124
124
  if tag_name > VERSION
125
125
  say "New update v#{tag_name} is available for gena.\nSee release notes: #{data['url']}", Color::YELLOW
126
+ if data['body'].length > 0
127
+ say "---------------------\n#{data['body']}\n---------------------", Color::YELLOW
128
+ end
126
129
  say "Please update by:\n#{set_color('gem install gena', Color::GREEN)}", Color::YELLOW
127
130
  end
128
131
 
data/lib/cli/init.rb CHANGED
@@ -2,8 +2,29 @@ module Gena
2
2
 
3
3
  class Application < Thor
4
4
 
5
- desc 'init', 'Initialize gena.plist with default parameters'
5
+ desc 'reconfigure [COMMAND]', 'Restores default parameters for plugin inside gena.plist'
6
+ def reconfigure(command)
7
+
8
+ $config = Gena::Config.new
9
+ $config.load_plist_config
10
+
11
+ data = $config.data[GENA_PLUGINS_CONFIG_KEY] || Hash.new
12
+
13
+ Application.plugin_classes.each do |klass|
14
+
15
+ plugin_config_name = klass.plugin_config_name
16
+ if plugin_config_name == command
17
+ say "Setting defaults for '#{command}'..", Color::GREEN
18
+ data[plugin_config_name] = klass.plugin_config_defaults
19
+ $config.data[GENA_PLUGINS_CONFIG_KEY] = data
20
+ $config.save!
21
+ return
22
+ end
23
+ end
24
+ say "Can't find plugin with name '#{command}'", Color::RED
25
+ end
6
26
 
27
+ desc 'init', 'Initialize gena.plist with default parameters'
7
28
  def init
8
29
 
9
30
  xcode_project_name = `find . -name *.xcodeproj`
@@ -209,10 +230,11 @@ module Gena
209
230
  data[plugin_config_name] = defaults
210
231
  elsif !data[plugin_config_name].keys.to_set.eql? defaults.keys.to_set
211
232
  missing_keys = defaults.keys - data[plugin_config_name].keys
212
- say "Adding missing config keys #{missing_keys} for plugin '#{plugin_config_name}.'", Color::GREEN
213
- missing_keys.each { |key| data[plugin_config_name][key] = defaults[key] }
233
+ if missing_keys.count > 0
234
+ say "Adding missing config keys #{missing_keys} for plugin '#{plugin_config_name}.'", Color::GREEN
235
+ missing_keys.each { |key| data[plugin_config_name][key] = defaults[key] }
236
+ end
214
237
  end
215
-
216
238
  end
217
239
 
218
240
  end
data/lib/constants.rb CHANGED
@@ -2,6 +2,6 @@ module Gena
2
2
  GENA_HOME = '~/.gena'
3
3
  GENA_UPDATE_CHECK_INTERVAL = 10800
4
4
  GENA_PLUGINS_CONFIG_KEY = 'configs'
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
  RELEASE_DATE = '2017-10-04'
7
- end
7
+ end
@@ -90,7 +90,9 @@ module Gena
90
90
 
91
91
  final_group = $xcode_project
92
92
  path_names.each_with_index do |group_name, index|
93
- final_group = final_group[group_name]
93
+ if final_group
94
+ final_group = final_group[group_name]
95
+ end
94
96
  end
95
97
 
96
98
  delete_node final_group
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gena
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksey Garbarev