Skip to content

Commit

Permalink
fix documents
Browse files Browse the repository at this point in the history
  • Loading branch information
tbpgr committed Jun 8, 2014
1 parent c620879 commit 69b1133
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 17 deletions.
87 changes: 72 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

GitCloner clone git repositoris from Gitclonerfile settings.

## Dependency
GitCloner depends on git. GitCloner use 'git clone' command.

## Installation

Add this line to your application's Gemfile:
Expand All @@ -20,19 +23,32 @@ Or install it yourself as:

$ gem install git_cloner

## CLI-Usage
## CLI Usage

### show help

~~~bash
gitcloner h
~~~

### generate Gitclonerfile

~~~bash
gitcloner init
~~~

or

~~~bash
gitcloner i
~~~

Gitclonerfile contents is...

~~~ruby
# encoding: utf-8

# default_output place
# default_output is required
# default_output allow only String
# default_output's default value => "./"
default_output "./"
Expand Down Expand Up @@ -76,31 +92,36 @@ repos [
]
~~~

### execute clone
### execute clone repositories

~~~bash
gitcloner clone
~~~

or

~~~bash
gitcloner c
~~~

### confirm clone result

~~~bash
$ tree
├─helper
| └spec_helper.rb
├─rspec_piccolo
| └many files...
├─sample
| ├rspec_piccolo_spec.rb
| └spec_helper.rb
├─tmp
| └rspec_piccolo
└─tbpgr_utils
└many files...
┠helper
┃ ┗spec_helper.rb
┠rspec_piccolo
┃ ┗many files...
┠sample
┃ ┠rspec_piccolo_spec.rb
┃ ┗spec_helper.rb
┠tmp
┃ ┗rspec_piccolo
┗tbpgr_utils
~~~

## Direct Usage
if you want to use GitCloner directry, you can use like this sample.
if you want to use GitCloner directry in your ruby logic, you can use like this sample.

~~~ruby
require 'git_cloner_core'
Expand All @@ -124,7 +145,43 @@ repos = [
GitCloner::Core.new.clone default_output, repos
~~~

## Sample Usage
You want to copy chef cookbooks(cookbook1, cookbook2) to cookbooks directory.

generate Gitclonerfile

~~~
gitcloner i
~~~

edit Gitclonerfile

~~~ruby
# encoding: utf-8
default_output "./cookbooks"
repos [
{place: "https://github.com/some_account/cookbook1.git"},
{place: "https://github.com/some_account/cookbook2.git"},
]
~~~

execute clone repositories

~~~bash
gitcloner c
~~~

confirm results

~~~
$ tree
┗cookbooks
┠cookbook1
┗cookbook2
~~~

## History
* version 0.0.4 : fix exit status.
* version 0.0.3 : enable direct call clone.
* version 0.0.2 : add files,directories copy.
* version 0.0.1 : first release.
Expand Down
2 changes: 1 addition & 1 deletion bin/gitcloner
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module GitCloner
class_option :help, type: :boolean, aliases: '-h', desc: 'help message.'
class_option :version, type: :boolean, desc: 'version'

desc 'clone', 'clone git repositories from Gitclonerfile'
desc 'clone', 'clone git repositories from Gitclonerfile settings'
def clone
GitCloner::Core.new.clone
rescue => e
Expand Down
2 changes: 1 addition & 1 deletion lib/git_cloner/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GitCloner
module GitCloner
VERSION = '0.0.3'
VERSION = '0.0.4'
end

0 comments on commit 69b1133

Please sign in to comment.