static_deploy 0.2.0 → 0.3.0

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
- SHA1:
3
- metadata.gz: d820edb97406f773505490a0d4fd5b71c0693cf6
4
- data.tar.gz: 65d2ff4bcd1248b0392dc74b9dcfb0bfeac752da
2
+ SHA256:
3
+ metadata.gz: 1873d1fea3044a35f6c5f56fdd30b283b071aa6a74ac053a7065b8d2ae2c3749
4
+ data.tar.gz: 133be672b6abef37cb16a483cbc77d37b8683ebd52188d45fee32558db906f4d
5
5
  SHA512:
6
- metadata.gz: 94f09dc0bf9174537ed9d5af9b7d03006c04c17e13f4f8b486a6e55bc73bf3911019a209a90b2bc27b62211a0c6cae983fa9cee4daf6ddd9dbaee877fefdf285
7
- data.tar.gz: 2ca6b15de82e45e108d4dc8750ec3564077a8ba6ed57d4fd6dce1bf293008e1026a91cc79b924eda3f099ce2b04cdc701dc09a94d900751bf7afe9f60bfefe7c
6
+ metadata.gz: 57ee9a0760d4c83b0e469942578a6337a9870340d771612cb9c56a673ff2d89351ac262eb7532eab7d5a2a3347eff1dfb8826732dda91445406e0655ab0df96f
7
+ data.tar.gz: 548597e02866d35d340d3115af98a12dd891efa7895a27c71efe4f8fc600e19e153a7765b6a4d4154a5d0e6307eac4e8a14f25732dc17e7a47bbb672b630d2c2
data/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # StaticDeploy
2
2
 
3
- Provides rake tasks for publishing your static website via git to any remote repository(GitHub pages).
3
+ [![Gem Version](https://badge.fury.io/rb/static_deploy.svg)][gem]
4
+ [![Build Status](https://secure.travis-ci.org/piotrmurach/static_deploy.svg?branch=master)][travis]
5
+
6
+ [gem]: http://badge.fury.io/rb/static_deploy
7
+ [travis]: http://travis-ci.org/piotrmurach/static_deploy
8
+
9
+ > Rake tasks to ease publishing a static website via git to a remote repository (e.g. GitHub pages).
4
10
 
5
11
  ## Installation
6
12
 
@@ -18,7 +24,7 @@ Or install it yourself as:
18
24
 
19
25
  ## Usage
20
26
 
21
- In your `Rakefile` add the following
27
+ In `Rakefile` add the following:
22
28
 
23
29
  ```ruby
24
30
  require 'static_deploy'
@@ -27,19 +33,19 @@ ENV['GENERATOR'] = 'jekyll' # => static website generator executable
27
33
  ENV['COMMAND'] = 'build' # => command for building a project, defaults to 'build'
28
34
  ```
29
35
 
30
- If you are deploying inside current repository, git defaults are used to get username and repository name
36
+ When deploying inside the current repository, git defaults are used to get username and repository name:
31
37
 
32
38
  ```ruby
33
39
  bundle exec rake site:publish
34
40
  ```
35
41
 
36
- Otherwise, to publish to remote branch on different repository do
42
+ Otherwise, to publish to remote branch in the different repository do:
37
43
 
38
44
  ```ruby
39
45
  bundle exec rake site:publish["username/repository"]
40
46
  ```
41
47
 
42
- As a convenience you may wish to add the following rake task to your `Rakefile`
48
+ As a convenience you may want to add the following rake task to your `Rakefile`:
43
49
 
44
50
  ```ruby
45
51
  desc 'publish this site'
@@ -58,4 +64,4 @@ end
58
64
 
59
65
  ## Copyright
60
66
 
61
- Copyright (c) 2013-2015 Piotr Murach. See LICENSE for further details.
67
+ Copyright (c) 2013 Piotr Murach. See LICENSE for further details.
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
-
3
- require "static_deploy/version"
1
+ require_relative "static_deploy/version"
4
2
 
5
3
  if defined?(Rake)
6
4
  Rake.load_rakefile(File.expand_path('../static_deploy/publish_task.rb', __FILE__))
@@ -1,15 +1,15 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'fileutils'
4
- require 'tty'
4
+ require 'tty-prompt'
5
5
 
6
6
  BUILD_DIR = "_site"
7
7
  ROOT = `git rev-parse --show-toplevel`.strip
8
8
  DEFAULT_URL = `git config --get remote.origin.url`.strip
9
9
  REGEX = /^.+:(.*)\/(.*).git$/
10
10
 
11
- def shell
12
- @shell ||= TTY::Shell.new
11
+ def prompt
12
+ @prompt ||= TTY::Prompt.new
13
13
  end
14
14
 
15
15
  def default_user
@@ -36,12 +36,12 @@ end
36
36
  namespace :site do
37
37
  desc "Prepare remote branch"
38
38
  task :prepare, [:repo] do |t, args|
39
- shell.say "=> Preparing...", color: :green
39
+ prompt.ok "=> Preparing..."
40
40
 
41
41
  mkdir_p BUILD_DIR
42
42
 
43
43
  cd BUILD_DIR do
44
- unless File.exists?(".git")
44
+ unless File.exist?(".git")
45
45
  sh "git init"
46
46
  sh "git remote add github git@github.com:#{args.repo}.git"
47
47
  sh "git fetch github"
@@ -60,7 +60,7 @@ namespace :site do
60
60
 
61
61
  desc "Fetch upstream changes on gh pages"
62
62
  task :sync, [:repo] do |t, args|
63
- shell.say "=> Synching...", color: :green
63
+ prompt.ok "=> Synching..."
64
64
 
65
65
  cd BUILD_DIR do
66
66
  sh "git fetch github"
@@ -72,7 +72,7 @@ namespace :site do
72
72
 
73
73
  desc "Compile files into #{BUILD_DIR} directory"
74
74
  task :build do
75
- shell.say "=> Building...", color: :green
75
+ prompt.ok "=> Building..."
76
76
 
77
77
  cd ROOT do
78
78
  sh "bundle exec #{generator} #{command}"
@@ -83,22 +83,22 @@ namespace :site do
83
83
  task :publish, [:repo] => [:prepare, :sync, :build] do |t, args|
84
84
  args.with_defaults(:repo => "#{default_user}/#{default_repo}")
85
85
 
86
- message = shell.ask "Provide a deployment message for #{args.repo}: ", color: :green do
87
- argument :required
88
- end.read_string
86
+ message = prompt.ask "Provide a deployment message for #{args.repo}: " do |q|
87
+ q.required true
88
+ end
89
89
 
90
- shell.say "=> Deploying to #{args.repo} GitHub Pages...", color: :green
90
+ prompt.ok "=> Deploying to #{args.repo} GitHub Pages..."
91
91
 
92
92
  cd BUILD_DIR do
93
93
  sh 'git add --all'
94
94
  if /nothing to commit/ =~ `git status`
95
- shell.say "No changes to commit.", color: :green
95
+ prompt.ok "No changes to commit."
96
96
  else
97
97
  sh "git commit -m '#{message.gsub("'", "\\'")}'"
98
98
  end
99
99
  sh "git push github gh-pages"
100
100
  end
101
101
 
102
- shell.say "Site build. OK", color: :green
102
+ prompt.ok "Site build. OK"
103
103
  end
104
104
  end
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module StaticDeploy
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -1,11 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe StaticDeploy do
4
- it 'should have a version number' do
5
- StaticDeploy::VERSION.should_not be_nil
6
- end
7
-
8
- it 'should do something useful' do
9
- false.should be_true
3
+ RSpec.describe StaticDeploy do
4
+ it 'has a version number' do
5
+ expect(StaticDeploy::VERSION).to_not be_nil
10
6
  end
11
7
  end
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'static_deploy/version'
@@ -13,12 +12,17 @@ Gem::Specification.new do |spec|
13
12
  spec.homepage = ""
14
13
  spec.license = "MIT"
15
14
 
16
- spec.files = `git ls-files`.split($/)
15
+ spec.files = Dir['{lib,spec}/**/*.rb', 'static_deploy.gemspec']
16
+ spec.files += Dir['README.md', 'LICENSE.txt', 'Rakefile']
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "tty", "0.2.1"
21
+ spec.required_ruby_version = '>= 2.0.0'
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_runtime_dependency 'tty-prompt', '~> 0.18'
24
+ spec.add_runtime_dependency 'rake'
25
+
26
+ spec.add_development_dependency 'bundler', '>= 1.5.0', '< 2.0'
27
+ spec.add_development_dependency 'rspec', '~> 3.1'
24
28
  end
metadata CHANGED
@@ -1,43 +1,77 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: static_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Murach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-25 00:00:00.000000000 Z
11
+ date: 2018-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: tty
14
+ name: tty-prompt
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.1
19
+ version: '0.18'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.1
26
+ version: '0.18'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - ~>
45
+ - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: '1.3'
47
+ version: 1.5.0
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '2.0'
34
51
  type: :development
35
52
  prerelease: false
36
53
  version_requirements: !ruby/object:Gem::Requirement
37
54
  requirements:
38
- - - ~>
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 1.5.0
58
+ - - "<"
39
59
  - !ruby/object:Gem::Version
40
- version: '1.3'
60
+ version: '2.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '3.1'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.1'
41
75
  description: Automated deployment to GitHub pages
42
76
  email:
43
77
  - pmurach@gmail.com
@@ -45,11 +79,6 @@ executables: []
45
79
  extensions: []
46
80
  extra_rdoc_files: []
47
81
  files:
48
- - .gitignore
49
- - .rspec
50
- - .ruby-version
51
- - .travis.yml
52
- - Gemfile
53
82
  - LICENSE.txt
54
83
  - README.md
55
84
  - Rakefile
@@ -69,17 +98,17 @@ require_paths:
69
98
  - lib
70
99
  required_ruby_version: !ruby/object:Gem::Requirement
71
100
  requirements:
72
- - - '>='
101
+ - - ">="
73
102
  - !ruby/object:Gem::Version
74
- version: '0'
103
+ version: 2.0.0
75
104
  required_rubygems_version: !ruby/object:Gem::Requirement
76
105
  requirements:
77
- - - '>='
106
+ - - ">="
78
107
  - !ruby/object:Gem::Version
79
108
  version: '0'
80
109
  requirements: []
81
110
  rubyforge_project:
82
- rubygems_version: 2.0.3
111
+ rubygems_version: 2.7.3
83
112
  signing_key:
84
113
  specification_version: 4
85
114
  summary: Provides rake tasks for publishing your static site to github pages to any
@@ -87,4 +116,3 @@ summary: Provides rake tasks for publishing your static site to github pages to
87
116
  test_files:
88
117
  - spec/spec_helper.rb
89
118
  - spec/static_deploy_spec.rb
90
- has_rdoc:
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
@@ -1 +0,0 @@
1
- 2.0.0
@@ -1,3 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.0.0
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- group :development do
6
- gem 'rake', '~> 10.4.2'
7
- gem 'rspec', '~> 3.2.0'
8
- gem 'yard', '~> 0.8.7'
9
- end