gito 0.4.10 → 0.4.11

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
2
  SHA1:
3
- metadata.gz: ec9dc7c8ba9fa9a6e354b9869e407c011d6b4ce1
4
- data.tar.gz: c4b3e9c2d494a8b85d622ab34686d167fe2bd816
3
+ metadata.gz: d1b89b0d99b76e03a3c147e7fcbb18c7c4183746
4
+ data.tar.gz: 04cde5b4dd4a9ede46f467a92d83ed3a44bb8945
5
5
  SHA512:
6
- metadata.gz: 656d7706405a6f0987fa407740ec042a6a74173c1e2de4450cc35b70e2ebb588455b5ff988661d9342dc0ebcacc6ce02513fb41be8039f8e8ccdd915fc306a90
7
- data.tar.gz: 52448da1016af99f414c6e2457d7e8bdf942e8da5da3cd63c4d677ea17acf7168af7387446117868e062e154bb190575eab7b06a39cad2c1fa0008de33a611f8
6
+ metadata.gz: d656ca79d2bed0ec63ae3a57738a6c338823d71508385831b4ce057f07435b72c9de34564640eddd0306e25300f37ac38b7180680800023e775acefe0bdebe59
7
+ data.tar.gz: ff916ae892e62d49b04a6150b1f25865b5ef41736eac8961fd3c8ca73f4835bcebffba8603ba21b6a1fa4759fd6da9fa89421249e1186057e3b4ef95a6b9e454
data/README.md CHANGED
@@ -15,12 +15,56 @@ git helper tool to **clone**/**open**/**auto-install**/**edit** a git project wi
15
15
  > <strong>gito</strong> <i>cesarferreira/dryrun -e</i>
16
16
  </p>
17
17
 
18
- ## Why?
19
- A lot of times I find myself wanting to try some code from github and in order to do so I have to copy the git URL, go to the terminal, git clone, find out the folder name, go to the folder and based on the type of project I need to `bundle install`, `./gradlew assemble`, `npm install`, `pip install .`, `mix deps.get`, `make install`, you name it. And after that opening it in my text editor of choice... Not anymore!
20
18
 
19
+ ## **Features**
20
+
21
+ - [x] Quickly clone any git project and changes directory.
22
+ - [x] Can automatically open the folder in `finder` .
23
+ - [x] Can automatically open the project in any editor.
24
+ - [x] Can clone the project into a system temporary folder.
25
+ - [x] Auto detects project type and auto installs dependencies accordingly.
26
+ - [x] The project type detections can be added without releasing a new `gem` version.
27
+ <!-- - [x] Supports macOS. -->
21
28
 
22
29
  ## Usage
23
30
 
31
+ 🚙 git clones this url: https://github.com/cesarferreira/dryrun
32
+
33
+ ```bash
34
+ $ gito cesarferreira/dryrun
35
+ ```
36
+
37
+ 🚕 git clone, install, open and edit the project
38
+ ```bash
39
+ $ gito cesarferreira/dryrun --edit --open
40
+ ```
41
+
42
+ 🚗 git clone on a operating system /temp/ folder, install, and edit the project
43
+ ```bash
44
+ $ gito cesarferreira/dryrun --edit --temp
45
+ ```
46
+
47
+ 🚓 set the editor to be 'subl' from now on
48
+ ```bash
49
+ $ gito cesarferreira/dryrun -s subl
50
+ ```
51
+
52
+ 🚕 git clone, install, open and edit the project from github on a temp folder
53
+ ```bash
54
+ $ gito https://github.com/cesarferreira/dryrun -e -o -t
55
+ ```
56
+
57
+ 🏎 git clone, install from another git source
58
+ ```bash
59
+ $ gito https://bitbucket.org/username/project
60
+ ```
61
+
62
+ ## Installation
63
+
64
+ $ gem install gito
65
+
66
+ ## Help
67
+
24
68
  ```bash
25
69
  $ gito -h
26
70
  Usage: gito GIT_URL [OPTIONS]
@@ -36,32 +80,8 @@ Options
36
80
  -v, --version Displays the version
37
81
  ```
38
82
 
39
- Examples:
40
- ```bash
41
- # git clone this https://github.com/cesarferreira/dryrun
42
- gito cesarferreira/dryrun
43
-
44
- # git clone, install, open and edit the project
45
- gito cesarferreira/dryrun --edit --open
46
-
47
- # git clone on a operating system /temp/ folder, install, and edit the project
48
- gito cesarferreira/dryrun --edit --temp
49
-
50
- # set the editor to be 'subl' from now on
51
- gito cesarferreira/dryrun -s subl
52
-
53
- # git clone, install, open and edit the project from github on a temp folder
54
- gito https://github.com/cesarferreira/dryrun -e -o -t
55
-
56
- # git clone, install from another git source
57
- gito https://bitbucket.org/username/project
58
- ```
59
-
60
- ## Installation
61
-
62
- $ gem install gito
63
83
 
64
- ## Supported type detections/auto-intalls
84
+ ## Supported type detections/auto-installs
65
85
  So far it auto-installs these types:
66
86
  - Ruby
67
87
  - Gradle
@@ -74,35 +94,12 @@ So far it auto-installs these types:
74
94
  - Carthage
75
95
  - Swift Package Manager
76
96
  - Rust
97
+ - Haskell
77
98
 
78
99
  Create a pull request by editing [detector.json](detector.json) file if you want more types to be added.
79
100
 
80
- ## Internally what happens?
81
-
82
- When you run this:
83
- ```bash
84
- gito cesarferreira/dryrun --edit --open
85
- ```
86
- This will happen:
87
- ```bash
88
- # clone
89
- git clone http://github.com/cesarferreira/dryrun
90
-
91
- # change directory
92
- cd dryrun
93
-
94
- # open an editor of choice if --editor flag
95
- atom .
96
-
97
- # open the folder if --open flag
98
- open .
99
-
100
- # find out what kind of project it is
101
- project_type_detector
102
-
103
- # because `ruby` was detected
104
- bundle install
105
- ```
101
+ ## Why?
102
+ A lot of times I find myself wanting to try some code from github and in order to do so I have to copy the git URL, go to the terminal, git clone, find out the folder name, go to the folder and based on the type of project I need to `bundle install`, `./gradlew assemble`, `npm install`, `pip install .`, `mix deps.get`, `make install`, you name it. And after that, opening it in my text editor of choice manually... Not anymore!
106
103
 
107
104
  ## Contributing
108
105
  I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure timely addition of your request:
@@ -58,5 +58,10 @@
58
58
  "file_requirement": "Cargo.toml",
59
59
  "installation_command": "cargo build --all",
60
60
  "type": "Rust - Cargo"
61
+ },
62
+ {
63
+ "file_requirement": "stack.yaml",
64
+ "installation_command": "stack build",
65
+ "type": "Haskell"
61
66
  }
62
67
  ]
@@ -23,7 +23,7 @@ class MainApp
23
23
  @options[:editor] = nil
24
24
  @options[:setting_up] = false
25
25
  @options[:is_temp] = false
26
- @options[:shell_copy] = true
26
+ @options[:shell_copy] = false
27
27
 
28
28
  # Parse Options
29
29
  create_options_parser(arguments)
@@ -56,8 +56,8 @@ class MainApp
56
56
  @options[:is_temp] = true
57
57
  end
58
58
 
59
- opts.on('-k', '--keep', 'Clones the whole git history and not just the last snapshot') do |is_temp|
60
- @options[:shell_copy] = false
59
+ opts.on('-c', '--shell-copy', 'Only makes a shell copy of the repository') do |is_temp|
60
+ @options[:shell_copy] = true
61
61
  end
62
62
 
63
63
  opts.on('-h', '--help', 'Displays help') do
@@ -64,7 +64,7 @@ class Project
64
64
 
65
65
  types.each do |item|
66
66
  if File.exists? (item['file_requirement'])
67
- puts "\n😎 #{item['type']} detected...\n".yellow
67
+ puts "😎 #{item['type']} detected...".yellow
68
68
  go_inside_and_run item['installation_command']
69
69
  end
70
70
  end
@@ -98,12 +98,13 @@ class Project
98
98
  @destination_dir = prefix + "#{@destination}"
99
99
 
100
100
  if File.directory?(@destination_dir)
101
- puts "\n🤔 The folder #{@destination_dir.green} is not empty...\n\n"
101
+ puts "🤔 The folder #{@destination_dir.green} is not empty..."
102
102
  go_inside_and_run "git reset --hard HEAD"
103
103
  go_inside_and_run "git pull"
104
104
  else
105
- puts "\n😙 Cloning #{url.green}...\n\n"
105
+ puts "😙 Cloning #{url.green}..."
106
106
  shell_copy_string = shell_copy ? '--depth 1' : ''
107
+ puts shell_copy_string
107
108
  AppUtils.execute("git clone #{shell_copy_string} --recursive #{url} #{@destination_dir}")
108
109
  end
109
110
 
@@ -111,12 +112,12 @@ class Project
111
112
  end
112
113
 
113
114
  def open_editor(app)
114
- puts "\n😁‍ Opening editor...".yellow
115
+ puts "😁‍ Opening editor...".yellow
115
116
  go_inside_and_run "#{app} ."
116
117
  end
117
118
 
118
119
  def open_folder
119
- puts "\n😳 Opening folder...".yellow
120
+ puts "😳 Opening folder...".yellow
120
121
  go_inside_and_run 'open .'
121
122
  end
122
123
 
@@ -1,3 +1,3 @@
1
1
  module Gito
2
- VERSION = '0.4.10'
2
+ VERSION = '0.4.11'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gito
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - cesar ferreira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-28 00:00:00.000000000 Z
11
+ date: 2017-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.6.11
131
+ rubygems_version: 2.6.12
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: git helper tool to clone/open/auto-install/edit a git project with a one-liner