site_hook 0.9.12 → 0.9.14

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: 5c46c2407883e386313160e3b21be0f5524f41bfaf00c5b5b9ac2902e484fe95
4
- data.tar.gz: d9ccb93480b61e1605262801fff2c2192ba9de14ef9ad1384746776812ee4a72
3
+ metadata.gz: 21410e9adb2efa53d97f8209ccbb05e1811d553b57df13e3abe42a18735dae33
4
+ data.tar.gz: 27338485f9bf897f8e36d6bc47a972de6cf177d2309891672d931e2715c6b849
5
5
  SHA512:
6
- metadata.gz: f13d13d6804028f9254340288eea6b1989543efc8132bc9b609289a94d23367583cc0c90b492d381c7043d32041ac6099a5b126703a7729df88b099b1b94f18e
7
- data.tar.gz: f4059d2ebf0e23167b358761f3476d878b4088940d9f8e65fc4b641ffeef5bb5b290456057a73bd7b17ca3e82b9faa9fe51d1242877f451bc2a78d30ded7c36d
6
+ metadata.gz: 3095f6adc9d4dd8566d37a63fb39d8d124518713aa8dd02d0de133211c7ece4fbea4234961cf3cf340f89289bf08a42bc70b473c4832acc457768e990a671948
7
+ data.tar.gz: 3ac627ce4eedb364ab105549344f60ddfbbfdd6dc2cb81e63acef310df01cce6c464ee1c8445dd699ac25df01182cbed3ab29fe6acc25ca77674ac7444077815
@@ -11,16 +11,20 @@ module SiteHook
11
11
  # map ['-v', '--version'] => __version
12
12
 
13
13
  desc 'gen [-o]', 'generate a sample config, -o will output to STDOUT instead of to the default config location'
14
- method_option(:output, type: :boolean, aliases: ['-o'], default: false)
14
+ method_option(:output, type: :boolean, default: false, aliases: '-o')
15
15
  def gen
16
16
  unless SiteHook::Paths.default_config.exist?
17
17
  if options[:output] == true
18
- puts SiteHook::ConfigSections.all_samples
18
+ say SiteHook::ConfigSections.all_samples
19
19
  else
20
- File.open(SiteHook::Paths.config, 'w') do |file|
20
+ File.open(SiteHook::Paths.config, 'w+') do |file|
21
21
  file.puts SiteHook::ConfigSections.all_samples
22
22
  end
23
23
  end
24
+ else
25
+ if options[:output] == true
26
+ say SiteHook::ConfigSections.all_samples
27
+ end
24
28
  end
25
29
 
26
30
  end
@@ -14,8 +14,8 @@ module SiteHook
14
14
  # puts SiteHook::VERSION
15
15
  # end
16
16
  # map ['-v', '--version'] => __version
17
- method_option(:host, banner: 'HOST', aliases: ['-h'], type: :string, default: SiteHook::Config.new.webhook.host)
18
- method_option(:port, banner: 'PORT', aliases: ['-p'], type: :numeric, default: SiteHook::Config.new.webhook.port)
17
+ method_option(:host, banner: 'HOST', aliases: ['-h'], type: :string, default: SiteHook::Config.new.class.webhook.host)
18
+ method_option(:port, banner: 'PORT', aliases: ['-p'], type: :numeric, default: SiteHook::Config.new.class.webhook.port)
19
19
  desc 'listen [options]', ''
20
20
  def listen
21
21
  $threads << Thread.new do
@@ -80,9 +80,11 @@ module SiteHook
80
80
  @@filename.empty?
81
81
  end
82
82
  rescue NoConfigError
83
- SiteHook::Commands::ConfigClass.invoke(:gen)
83
+ #SiteHook::Commands::ConfigClass.invoke()
84
+ puts SiteHook::Commands::ConfigClass.methods
84
85
  rescue NeitherConfigError
85
- SiteHook::Commands::ConfigClass.invoke(:gen)
86
+ #SiteHook::Commands::ConfigClass.invoke(:gen)
87
+ puts SiteHook::Commands::ConfigClass.methods
86
88
  end
87
89
 
88
90
  # @return [Webhook]
@@ -44,7 +44,9 @@ module SiteHook
44
44
  end
45
45
  end
46
46
  rescue SiteHook::NeitherConfigError
47
- path = self.config
47
+ if self.dir.exist?
48
+ path = self.config
49
+ end
48
50
  end
49
51
  path
50
52
  end
@@ -1,3 +1,3 @@
1
1
  module SiteHook
2
- VERSION = '0.9.12'
2
+ VERSION = '0.9.14'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_hook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.12
4
+ version: 0.9.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer