static_deploy 0.1.0 → 0.2.0
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 +4 -4
- data/README.md +15 -6
- data/lib/static_deploy/publish_task.rb +14 -4
- data/lib/static_deploy/version.rb +3 -1
- data/lib/static_deploy.rb +2 -0
- data/static_deploy.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d820edb97406f773505490a0d4fd5b71c0693cf6
|
4
|
+
data.tar.gz: 65d2ff4bcd1248b0392dc74b9dcfb0bfeac752da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94f09dc0bf9174537ed9d5af9b7d03006c04c17e13f4f8b486a6e55bc73bf3911019a209a90b2bc27b62211a0c6cae983fa9cee4daf6ddd9dbaee877fefdf285
|
7
|
+
data.tar.gz: 2ca6b15de82e45e108d4dc8750ec3564077a8ba6ed57d4fd6dce1bf293008e1026a91cc79b924eda3f099ce2b04cdc701dc09a94d900751bf7afe9f60bfefe7c
|
data/README.md
CHANGED
@@ -18,25 +18,34 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
In your Rakefile add the following
|
21
|
+
In your `Rakefile` add the following
|
22
22
|
|
23
23
|
```ruby
|
24
|
-
|
24
|
+
require 'static_deploy'
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
ENV['GENERATOR'] = 'jekyll' # => static website generator executable
|
27
|
+
ENV['COMMAND'] = 'build' # => command for building a project, defaults to 'build'
|
28
28
|
```
|
29
29
|
|
30
30
|
If you are deploying inside current repository, git defaults are used to get username and repository name
|
31
31
|
|
32
32
|
```ruby
|
33
|
-
|
33
|
+
bundle exec rake site:publish
|
34
34
|
```
|
35
35
|
|
36
36
|
Otherwise, to publish to remote branch on different repository do
|
37
37
|
|
38
38
|
```ruby
|
39
|
-
|
39
|
+
bundle exec rake site:publish["username/repository"]
|
40
|
+
```
|
41
|
+
|
42
|
+
As a convenience you may wish to add the following rake task to your `Rakefile`
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
desc 'publish this site'
|
46
|
+
task :publish do
|
47
|
+
Rake::Task['site:publish'].invoke("username/repository")
|
48
|
+
end
|
40
49
|
```
|
41
50
|
|
42
51
|
## Contributing
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'fileutils'
|
2
4
|
require 'tty'
|
3
5
|
|
@@ -33,7 +35,7 @@ end
|
|
33
35
|
|
34
36
|
namespace :site do
|
35
37
|
desc "Prepare remote branch"
|
36
|
-
task :prepare do |t, args|
|
38
|
+
task :prepare, [:repo] do |t, args|
|
37
39
|
shell.say "=> Preparing...", color: :green
|
38
40
|
|
39
41
|
mkdir_p BUILD_DIR
|
@@ -43,13 +45,21 @@ namespace :site do
|
|
43
45
|
sh "git init"
|
44
46
|
sh "git remote add github git@github.com:#{args.repo}.git"
|
45
47
|
sh "git fetch github"
|
46
|
-
|
48
|
+
`git ls-remote --exit-code git@github.com:#{args.repo}.git gh-pages`
|
49
|
+
if $?.success?
|
50
|
+
sh "git checkout -b gh-pages --track github/gh-pages"
|
51
|
+
else
|
52
|
+
`echo "text" > sample.txt`
|
53
|
+
sh "git add sample.txt"
|
54
|
+
sh "git commit -am 'Sample text'"
|
55
|
+
sh "git checkout --orphan gh-pages"
|
56
|
+
end
|
47
57
|
end
|
48
58
|
end
|
49
59
|
end
|
50
60
|
|
51
|
-
desc "Fetch upstream changes on
|
52
|
-
task :sync do
|
61
|
+
desc "Fetch upstream changes on gh pages"
|
62
|
+
task :sync, [:repo] do |t, args|
|
53
63
|
shell.say "=> Synching...", color: :green
|
54
64
|
|
55
65
|
cd BUILD_DIR do
|
data/lib/static_deploy.rb
CHANGED
data/static_deploy.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
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.
|
21
|
+
spec.add_dependency "tty", "0.2.1"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: static_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.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-
|
11
|
+
date: 2015-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.
|
19
|
+
version: 0.2.1
|
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.
|
26
|
+
version: 0.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|