jekyll_push 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
  SHA256:
3
- metadata.gz: b0a8a44d8be31ec91a15c4c3b1a0865a64a66348f2ea250e1a1903ab4f362c84
4
- data.tar.gz: 7e6ad00bad5aa41806c3a6e1297c03370620f9a4af61861d86d84145c2c8ce3f
3
+ metadata.gz: 29bfccecd23f571b59ee7933cacc207c1ff06f46a3cf052d4e2684a6d9b69714
4
+ data.tar.gz: 8c47f936c1988284b45f4a278b3ed36224e0b3ac9d427963504f26a3dd47ecb6
5
5
  SHA512:
6
- metadata.gz: 3998d73d53be927fa7835148b24b0b372bc8434643a0fa96993fdb70919cc1a3638dca5ddac7f1c018860c8e28da7d4a693ef567f21018cc1a2eb29161c96ee5
7
- data.tar.gz: b4a18d3bbd4d5942e50da728abef94f2387a5931cda4c6dce419fc7ffa32ec7171b5d6c1f29e42fbdc800d1ff7d3e603b2aae336c6d0b64de9b572a5526bb812
6
+ metadata.gz: b06e3db28cd27763adfeb95d448acd986fc3b17aa71929c2313142822d3548d59dca72b24ad4e87e1a243e855e397acd821a523ce9f2e9cd2f6fb8daa87caed5
7
+ data.tar.gz: 45d33f897f000a6d8ac10cffea4d74455e0c7c23edcea9e8930eb6d7069dc78cba71653437d6e6f109f338f0e98c88e341cfc8ad845f1b13c446eb07ef681689
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'jekyll_push'
5
- spec.version = '0.1.1'
5
+ spec.version = '0.1.2'
6
6
  spec.authors = ['marii']
7
7
  spec.email = ['m.s.nyrop@gmail.com']
8
8
 
@@ -18,9 +18,9 @@ require_relative 'jekyll_push/utils'
18
18
  module JekyllPush
19
19
  #
20
20
  # @return [Nil]
21
- def self.run_command(arg)
21
+ def self.run_command(arg, opts)
22
22
  site = JekyllPush::Site.new
23
- branch = JekyllPush::Branch.new arg
23
+ branch = JekyllPush::Branch.new arg, opts
24
24
 
25
25
  site.rebuild branch.target
26
26
  branch.push site.dir
@@ -7,7 +7,7 @@ module JekyllPush
7
7
  attr_reader :target
8
8
 
9
9
  # @param target [String] the name of the Git branch to deploy to
10
- def initialize(target)
10
+ def initialize(target, opts)
11
11
  @target = JekyllPush::Utils.slugify target
12
12
  @time = Time.now.strftime('%H:%M on %Y-%m-%d')
13
13
 
@@ -15,7 +15,7 @@ module JekyllPush
15
15
  (class << self; include JekyllPush::Local; end) if local?
16
16
 
17
17
  @commit = commit
18
- @origin = origin
18
+ @origin = origin opts
19
19
  @msg = msg
20
20
 
21
21
  raise JekyllPush::Error::NoOrigin, 'No remote origin was found for the project GitHub repository.' if @origin.empty?
@@ -9,10 +9,12 @@ module JekyllPush
9
9
  prog.command(:push) do |c|
10
10
  c.syntax 'push [args]'
11
11
  c.description 'pushes compiled site to specified github branch'
12
- c.action do |args, _opts|
12
+ c.option :user, '--user USER', 'Override GitHub user name use'
13
+ c.option :pw, '--pw PASSWORD', 'Override GitHub user password to use'
14
+ c.action do |args, opts|
13
15
  raise Error::MissingBranch, "You must specify a target branch name after 'jekyll push'." if args.empty?
14
16
 
15
- args.each { |a| JekyllPush.run_command a }
17
+ args.each { |a| JekyllPush.run_command a, opts }
16
18
  end
17
19
  end
18
20
  end
@@ -12,7 +12,7 @@ module JekyllPush
12
12
 
13
13
  #
14
14
  # @return [String]
15
- def origin
15
+ def origin(_opts)
16
16
  `git config --get remote.origin.url`.strip
17
17
  end
18
18
 
@@ -12,10 +12,10 @@ module JekyllPush
12
12
 
13
13
  #
14
14
  # @return [String]
15
- def origin
15
+ def origin(opts)
16
16
  @repo_slug = ENV['TRAVIS_REPO_SLUG']
17
- @user = @repo_slug.split('/').first
18
- @token = ENV['ACCESS_TOKEN']
17
+ @user = opts.fetch :user, @repo_slug.split('/').first
18
+ @token = opts.fetch :pw, ENV['ACCESS_TOKEN']
19
19
 
20
20
  "https://#{@user}:#{@token}@github.com/#{@repo_slug}.git"
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_push
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
  - marii
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-30 00:00:00.000000000 Z
11
+ date: 2019-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll