detroit-github 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d2cfc8fd4027b3889192296e34fe61eb88d48cf2
4
+ data.tar.gz: d1945a9ad213b2fa71707c91f1eecc434fafa63e
5
+ SHA512:
6
+ metadata.gz: 40f47f07b88c01cdc192d374830e693d08cf24415bf42ef510daff79c39b97a52491707d5cde8291ff1daede33253cf45a5256cc7320c7589da92d4dcb5287d4
7
+ data.tar.gz: d66a85a390e5ab08de05e5ba500153ddfa6f3c24d905c79e0dc85eea7ccecbd9ddd360b21989c1b8cb987e79b20124ba2562957d74132240c2b1e468809226ef
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # Detroit GitHub Tool
2
+
3
+ [Website](http://rubyworks.github.com/detroit-github) /
4
+ [Report Issue](http://github.com/rubyworks/detroit-github/issues) /
5
+ [Development](http://github.com/rubyworks/detroit-github)
6
+
7
+ [![Build Status](https://secure.travis-ci.org/rubyworks/detroit-github.png)](http://travis-ci.org/rubyworks/detroit-github)
8
+ [![Gem Version](https://badge.fury.io/rb/detroit-github.png)](http://badge.fury.io/rb/detroit-github)    
9
+ [![Flattr Me](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/324911/Rubyworks-Ruby-Development-Fund)
10
+
11
+
12
+ ## About
13
+
14
+ The GitHub tool provides services tied to your project's github repository.
15
+ Currently it only supports gh-pages publishing from a project's website directory.
16
+
17
+ When you first run the github tool, it will look for a `web` project directory
18
+ (or the directory as specified by the `folder` setting). If it does not exist
19
+ it will create it by checking out the reposistory and making `gh-pages` the
20
+ sole branch.
21
+
22
+ Be sure to add `web` (or your configured site directory) in `.gitignore`.
23
+
24
+
25
+ ## Install
26
+
27
+ ### With RubyGems
28
+
29
+ Per the usual gem install process:
30
+
31
+ $ gem install detroit-github
32
+
33
+ Or using Bundler add it to the Gemfile.
34
+
35
+ gem "detroit-github"
36
+
37
+ If using Indexer, make sure `detroit-github` is in your `requirements`.
38
+
39
+
40
+ ## Legal
41
+
42
+ Detroit GitHub ·; Copyright (c) 2011 Rubyworks
43
+
44
+ This program is free software: you can redistribute it and/or modify
45
+ it under the terms of the GNU General Public License as published by
46
+ the Free Software Foundation, either version 3 of the License, or
47
+ (at your option) any later version.
48
+
49
+ This program is distributed in the hope that it will be useful,
50
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
51
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52
+ GNU General Public License for more details.
53
+
54
+ See LICENSE.txt for details.
55
+
@@ -1,34 +1,53 @@
1
- require 'detroit/tool'
1
+ require 'detroit-standard'
2
2
 
3
3
  module Detroit
4
4
 
5
- # Convenience method for creating a GitHub tool instance.
6
- def GitHub(options={})
7
- GitHub.new(options)
8
- end
5
+ # FIXME: Sitemap feature is out-of-order!
9
6
 
7
+ ##
10
8
  # GitHub tool provides services for working with your
11
9
  # project's github repository.
12
10
  #
13
11
  # Currently it only supports gh-pages publishing.
14
12
  #
15
- # IMPORTNAT: This tool is useless unless your project is hosted on GitHub!
13
+ # The following stations of the standard toolchain are targeted:
14
+ #
15
+ # * prepare
16
+ # * publish
17
+ # * clean
18
+ #
19
+ # @note This tool is useless unless your project is hosted on GitHub!
16
20
  class GitHub < Tool
17
21
 
22
+ # Works with the Standard assembly.
23
+ #
24
+ # @!parse
25
+ # include Standard
26
+ #
27
+ assembly Standard
28
+
29
+ # Location of manpage for tool.
30
+ MANPAGE = File.dirname(__FILE__)+'/../man/detroit-github.5'
31
+
18
32
  #
19
33
  PAGES_BRANCH = "gh-pages"
20
34
 
21
35
  # The project directory to store the gh-pages git repo.
22
36
  DEFAULT_FOLDER = "web"
23
37
 
24
- #
38
+ # Default remote name.
25
39
  DEFAULT_REMOTE = "origin"
26
40
 
27
41
  # Default commit message.
28
42
  DEFAULT_MESSAGE = "Update pages via Detroit."
29
43
 
30
-
31
- # A T T R I B U T E S
44
+ #
45
+ def prerequisite
46
+ @branch = PAGES_BRANCH
47
+ @folder = DEFAULT_FOLDER
48
+ @remote = DEFAULT_REMOTE
49
+ @message = DEFAULT_MESSAGE
50
+ end
32
51
 
33
52
  # The remote to use (defaults to 'origin').
34
53
  attr_accessor :remote
@@ -76,29 +95,6 @@ module Detroit
76
95
  # The repository branch (ALWAYS "gh-pages").
77
96
  attr_reader :branch
78
97
 
79
- # A S S E M B L Y
80
-
81
- # Do not need to `prepare` if gh_pages directory is already created.
82
- def assemble?(station, options={})
83
- case station
84
- when :prepare
85
- child ? false : true
86
- when :publish, :clean
87
- true
88
- end
89
- end
90
-
91
- # Attach to `prepare`, `publish` and `clean`.
92
- def assemble(station, options={})
93
- case station
94
- when :prepare then prepare
95
- when :publish then publish
96
- when :clean then clean
97
- end
98
- end
99
-
100
- # S E R V I C E M E T H O D S
101
-
102
98
  #
103
99
  def prepare
104
100
  return if child
@@ -119,11 +115,16 @@ module Detroit
119
115
  update_gitignore
120
116
  end
121
117
 
122
- #
118
+ # We do not need to prepare if gh_pages directory is already created.
119
+ def prepare?
120
+ !child
121
+ end
122
+
123
123
  # Publish sitemap files to branch (gh-pages).
124
124
  #
125
- # @todo Should we all `git add --all` ?
125
+ # @todo Should we `git add --all` ?
126
126
  #
127
+ # @return [void]
127
128
  def publish
128
129
  if !File.directory?(pgdir)
129
130
  report "No pages folder found (#{folder})."
@@ -139,11 +140,31 @@ module Detroit
139
140
  end
140
141
  end
141
142
 
142
- #
143
+ # Remove temporary directory.
143
144
  def clean
144
145
  rm_r File.join(Dir.tmpdir, 'detroit', 'github')
145
146
  end
146
147
 
148
+ # @method :station_publish(opts = {})
149
+ station :prepare
150
+
151
+ # @method :station_publish(opts = {})
152
+ station :publish
153
+
154
+ # @method :station_clean(opts = {})
155
+ station :clean
156
+
157
+ # This tool ties into the `prepare`, `publish` and `clean` stations of the
158
+ # standard assembly.
159
+ #
160
+ # @return [Boolean]
161
+ def assemble?(station, options={})
162
+ return true if station == :prepare
163
+ return true if station == :publish
164
+ return true if station == :purge
165
+ return false
166
+ end
167
+
147
168
  private
148
169
 
149
170
  # NOTE: Considered using `sh %[git clone --local . #{pgdir}]` but
@@ -193,15 +214,7 @@ module Detroit
193
214
  end
194
215
  end
195
216
 
196
- # TODO: Does the POM Project provide the site folder?
197
-
198
- #
199
- def initialize_defaults
200
- @branch ||= PAGES_BRANCH
201
- @folder ||= DEFAULT_FOLDER
202
- @remote ||= DEFAULT_REMOTE
203
- @message ||= DEFAULT_MESSAGE
204
- end
217
+ # TODO: Does the Project provide the site folder?
205
218
 
206
219
  # TODO: Switch to `scm` gem if it is better than grit.
207
220
 
@@ -318,12 +331,6 @@ module Detroit
318
331
  end
319
332
  =end
320
333
 
321
- public
322
-
323
- def self.man_page
324
- File.dirname(__FILE__)+'/../man/detroit-github.5'
325
- end
326
-
327
334
  end
328
335
 
329
336
  end
@@ -3,14 +3,13 @@ detroit-github(5) - github services for detroit
3
3
 
4
4
  ## DESCRIPTION
5
5
 
6
- The GitHub tool provides services tied to your project's
7
- github repository. Presently it only supports gh-pages
8
- publishing.
6
+ The Github plugin provides services tied to a project's Github
7
+ repository. Presently it supports gh-pages publishing.
9
8
 
10
9
  ## OPTIONS
11
10
 
12
- The following options can be used in Detroit assembly files
13
- for defining a github service.
11
+ The following options can be used in Detroit toolchain files
12
+ for defining a Github tool instance.
14
13
 
15
14
  * `remote` - The remote to use (defaults to 'origin').
16
15
 
@@ -42,12 +41,12 @@ to a directory called `doc` we could use:
42
41
  site: .
43
42
  doc: doc
44
43
 
45
- However, this isn't usually necessary, since a soft link could be used
44
+ However, this isn't usually necessary, since a symlink could be used
46
45
  instead.
47
46
 
48
47
  $ ln -s doc site/doc
49
48
 
50
- You can check soft-links into with git and they will be transferred as
49
+ You can check symlinks into git and they will be transferred as
51
50
  if the real file when copied to the gh-pages file. So a more complex
52
51
  `sitemap` is really only needed when more specific selections or
53
52
  complex globs are needed.
@@ -64,9 +63,9 @@ For more information:
64
63
 
65
64
  ## COPYRIGHT
66
65
 
67
- Copyright (c) 2010 Thomas Sawyer, Rubyworks
66
+ Copyright (c) 2010 Rubyworks
68
67
 
69
- Detroit GitHub is distributable in accordance with the GPLv3 license.
68
+ Detroit GitHub is distributable in accordance with the GPL v3 license.
70
69
 
71
70
 
72
71
  ## SEE ALSO
metadata CHANGED
@@ -1,38 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: detroit-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - T. Sawyer
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-04-02 00:00:00.000000000 Z
11
+ date: 2014-01-14 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: detroit
16
- requirement: &16794180 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.3.0
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *16794180
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.3.0
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: grit
27
- requirement: &16786740 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *16786740
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  description: GitHub plugin for Detroit build system.
37
42
  email:
38
43
  - transfire@gmail.com
@@ -40,40 +45,37 @@ executables: []
40
45
  extensions: []
41
46
  extra_rdoc_files:
42
47
  - LICENSE.txt
43
- - README.rdoc
44
- - COPYING.rdoc
48
+ - README.md
45
49
  files:
46
- - .ruby
47
50
  - lib/detroit-github.rb
48
51
  - man/detroit-github.5
49
52
  - man/detroit-github.5.html
50
53
  - man/detroit-github.5.ronn
54
+ - README.md
51
55
  - LICENSE.txt
52
- - README.rdoc
53
- - COPYING.rdoc
54
56
  homepage: http://detroit.github.com/
55
57
  licenses:
56
- - GPL3
58
+ - GPL-3.0
59
+ metadata: {}
57
60
  post_install_message:
58
61
  rdoc_options: []
59
62
  require_paths:
60
63
  - lib
61
64
  required_ruby_version: !ruby/object:Gem::Requirement
62
- none: false
63
65
  requirements:
64
- - - ! '>='
66
+ - - '>='
65
67
  - !ruby/object:Gem::Version
66
68
  version: '0'
67
69
  required_rubygems_version: !ruby/object:Gem::Requirement
68
- none: false
69
70
  requirements:
70
- - - ! '>='
71
+ - - '>='
71
72
  - !ruby/object:Gem::Version
72
73
  version: '0'
73
74
  requirements: []
74
75
  rubyforge_project:
75
- rubygems_version: 1.8.11
76
+ rubygems_version: 2.0.3
76
77
  signing_key:
77
- specification_version: 3
78
+ specification_version: 4
78
79
  summary: GitHub plugin for Detroit
79
80
  test_files: []
81
+ has_rdoc:
data/.ruby DELETED
@@ -1,35 +0,0 @@
1
- ---
2
- source:
3
- - meta
4
- authors:
5
- - name: T. Sawyer
6
- email: transfire@gmail.com
7
- copyrights:
8
- - holder: Thomas Sawyer
9
- year: '2011'
10
- license: GPL3
11
- requirements:
12
- - name: detroit
13
- version: 0.3.0+
14
- - name: grit
15
- dependencies: []
16
- alternatives: []
17
- conflicts: []
18
- repositories: []
19
- resources:
20
- home: http://detroit.github.com/
21
- code: http://github.com/detroit/detroit-github
22
- mail: http://groups.google.com/group/rubyworks-mailinglist
23
- extra: {}
24
- load_path:
25
- - lib
26
- revision: 0
27
- created: '2011-10-16'
28
- summary: GitHub plugin for Detroit
29
- title: Detroit GitHub
30
- version: 0.2.0
31
- name: detroit-github
32
- suite: detroit
33
- description: GitHub plugin for Detroit build system.
34
- organization: rubyworks
35
- date: '2012-04-01'
data/COPYING.rdoc DELETED
@@ -1,24 +0,0 @@
1
- = COPYRIGHT NOTICES
2
-
3
- == Detroit GitHub
4
-
5
- Copyright:: (c) 2011 Thomas Sawyer, Rubyworks
6
- License:: GPL-3
7
- Website:: http://detroit.github.com
8
-
9
- Copyright (c) 2011 Thomas Sawyer
10
-
11
- This program is free software: you can redistribute it and/or modify
12
- it under the terms of the GNU General Public License as published by
13
- the Free Software Foundation, either version 3 of the License, or
14
- (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program. If not, see <http://www.gnu.org/licenses/>.
23
-
24
-
data/README.rdoc DELETED
@@ -1,32 +0,0 @@
1
- = Detroit GitHub Tool
2
-
3
- {Website}[http://rubyworks.github.com/detroit-github] /
4
- {Report Issue}[http://github.com/rubyworks/detroit-github/issues] /
5
- {Repository}[http://github.com/rubyworks/detroit-github]
6
-
7
-
8
- == Description
9
-
10
- The GitHub tool provides services tied to your project's
11
- github repository.
12
-
13
- Currently it only supports gh-pages publishing from a
14
- project's website directory.
15
-
16
-
17
- == Installation
18
-
19
- Per the usual gem install process:
20
-
21
- $ gem install detroit-github
22
-
23
-
24
- == Copyrights
25
-
26
- Copyright (c) 2011 Thomas Sawyer
27
-
28
- Detroit GitHub is distributable in accordance with the GPL, GNU General Public
29
- License, version 3 or higher.
30
-
31
- See COPYING.rdoc and LICENSE.txt file for details.
32
-