site_hook 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.rspec +0 -0
  4. data/.rubocop.yml +0 -0
  5. data/.travis.yml +0 -0
  6. data/Gemfile +0 -0
  7. data/LICENSE.txt +0 -0
  8. data/README.md +0 -0
  9. data/Rakefile +0 -0
  10. data/features/get_help.feature +0 -0
  11. data/features/step_definitions/get_help_step_definition.rb +0 -0
  12. data/features/step_definitions/my_steps.rb +0 -0
  13. data/features/support/env.rb +0 -0
  14. data/lib/site_hook.rb +0 -0
  15. data/lib/site_hook/cli.rb +0 -0
  16. data/lib/site_hook/commands/config_class.rb +10 -4
  17. data/lib/site_hook/commands/jekyll_class.rb +0 -0
  18. data/lib/site_hook/commands/server_class.rb +0 -0
  19. data/lib/site_hook/config.rb +0 -0
  20. data/lib/site_hook/config_sections.rb +0 -0
  21. data/lib/site_hook/deprecate.rb +0 -0
  22. data/lib/site_hook/env/env.rb +0 -0
  23. data/lib/site_hook/exceptions.rb +0 -0
  24. data/lib/site_hook/log.rb +0 -0
  25. data/lib/site_hook/logger.rb +0 -0
  26. data/lib/site_hook/loggers.rb +0 -0
  27. data/lib/site_hook/loggers/access.rb +0 -0
  28. data/lib/site_hook/loggers/app.rb +0 -0
  29. data/lib/site_hook/loggers/build.rb +0 -0
  30. data/lib/site_hook/loggers/fake.rb +0 -0
  31. data/lib/site_hook/loggers/git.rb +0 -0
  32. data/lib/site_hook/loggers/hook.rb +0 -0
  33. data/lib/site_hook/methods.rb +0 -0
  34. data/lib/site_hook/paths.rb +21 -13
  35. data/lib/site_hook/prelogger.rb +0 -0
  36. data/lib/site_hook/prompt.rb +0 -0
  37. data/lib/site_hook/prompts/prompt_project.rb +0 -0
  38. data/lib/site_hook/runner.rb +0 -0
  39. data/lib/site_hook/sender.rb +0 -0
  40. data/lib/site_hook/string_ext.rb +0 -0
  41. data/lib/site_hook/version.rb +1 -1
  42. data/lib/site_hook/webhook.rb +0 -0
  43. data/site_hook.gemspec +0 -0
  44. data/sonar-project.properties +0 -0
  45. data/spec/spec_helper.rb +0 -0
  46. data/spec/string_ext_spec.rb +0 -0
  47. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e533b5ff7dd282a84eeaa5de0fe7472953efb51af9adff90a1425fa4a77692f9
4
- data.tar.gz: 6ca03fd4dae89598062d7c4a3cfe7c9ce75625c48728155d83c2a935b09f4f85
3
+ metadata.gz: df7ac78096b79b21f4820c3bf45ae803cba852e1de713631e915d1dfb783ca30
4
+ data.tar.gz: 0affd937fdab4e2993ac1732b4647fd0d35ce4dc67ac8e56f5f29604c3db303f
5
5
  SHA512:
6
- metadata.gz: a4644ac7761a8915860684ab0f9fb475eec4dec69eafb607eca22a07aad2f75b6896d8c1e392fa09435de17e385fb47ff7b93995b6b24bbd4386045ef8d5532e
7
- data.tar.gz: 429f4f362ad052c9d207daaea2f61989c45c586e1db24d56956132471d9be8bb81520a457cddf8ca14808147824c641b97fe9911844ec971dd15182b16e64a01
6
+ metadata.gz: 57d4090ea3292daea27c45d250d4fdb1fc050d6c2e3c17a66e577b3aefc7ced81568421de9d20db54c98b98ec74b28ae5fb53deb28b6f2275643fa168ab02a65
7
+ data.tar.gz: 42249cef8dc434780768db032e273542ccb6cf1dc2811e0d01c64d930898bc3491deb99f36af565d76b36e5e35de57f2718eb0fea4a13cd45ac4644d1bc372a0
data/.gitignore CHANGED
@@ -13,4 +13,5 @@
13
13
  .rspec_status
14
14
  /Gemfile.lock
15
15
  vendor/
16
- /.scannerwork
16
+ /.scannerwork
17
+ /.rake_tasks*
data/.rspec CHANGED
File without changes
File without changes
File without changes
data/Gemfile CHANGED
File without changes
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -10,11 +10,17 @@ module SiteHook
10
10
  # end
11
11
  # map ['-v', '--version'] => __version
12
12
 
13
- desc 'gen [options]', 'generate a sample config'
14
-
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)
15
15
  def gen
16
- if SiteHook::Paths.default_config.exist?
17
- puts SiteHook::ConfigSections.all_samples
16
+ unless SiteHook::Paths.default_config.exist?
17
+ if options[:output] == true
18
+ puts SiteHook::ConfigSections.all_samples
19
+ else
20
+ File.open(SiteHook::Paths.config, 'w') do |file|
21
+ file.puts SiteHook::ConfigSections.all_samples
22
+ end
23
+ end
18
24
  end
19
25
 
20
26
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -33,27 +33,35 @@ module SiteHook
33
33
  end
34
34
  def self.default_config(old_exists = self.old_config.exist?, new_exists = self.config.exist?)
35
35
  path = ''
36
- if old_exists
37
- path = self.old_config
38
- else
39
- if new_exists
40
- path = self.config
36
+ begin
37
+ if old_exists
38
+ path = self.old_config
41
39
  else
42
- raise NoConfigError path
40
+ if new_exists
41
+ path = self.config
42
+ else
43
+ raise SiteHook::NeitherConfigError.new path
44
+ end
43
45
  end
46
+ rescue SiteHook::NeitherConfigError
47
+ path = self.config
44
48
  end
45
49
  path
46
50
  end
47
51
  def self.default_logs(old_exists = self.old_logs.exist?, new_exists = self.logs.exist?)
48
52
  path = ''
49
- if old_exists
50
- path = self.old_logs
51
- else
52
- if new_exists
53
- path = self.logs
53
+ begin
54
+ if old_exists
55
+ path = self.old_logs
54
56
  else
55
- raise NoLogsError path
57
+ if new_exists
58
+ path = self.logs
59
+ else
60
+ raise SiteHook::NoLogsError.new path
61
+ end
56
62
  end
63
+ rescue SiteHook::NoLogsError
64
+ path = self.logs
57
65
  end
58
66
  path
59
67
  end
@@ -79,7 +87,7 @@ module SiteHook
79
87
  self.logs.join("#{klass.to_s.safe_log_name}#{level}.log")
80
88
  else
81
89
  path ||= SiteHook::Paths.logs
82
- raise SiteHook::NoLogsError path
90
+ raise SiteHook::NoLogsError.new path
83
91
  end
84
92
 
85
93
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module SiteHook
2
- VERSION = '0.9.4'
2
+ VERSION = '0.9.5'
3
3
  end
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_hook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-10 00:00:00.000000000 Z
11
+ date: 2019-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  version: '0'
313
313
  requirements: []
314
314
  rubyforge_project:
315
- rubygems_version: 2.7.6.2
315
+ rubygems_version: 2.7.6
316
316
  signing_key:
317
317
  specification_version: 4
318
318
  summary: Catch a POST request from a git service push webhook and build a jekyll site.