easy_start 0.1.2 → 0.1.3
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/Gemfile.lock +35 -0
- data/README.md +33 -3
- data/bin/easy_start +27 -1
- data/easy_start-0.1.2.gem +0 -0
- data/lib/easy_start.rb +26 -3
- data/lib/easy_start/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 117afa6c490363f1dd33d8f9e802e1dff39e8581
|
4
|
+
data.tar.gz: 3505ffe63dcd3c709ecc4672b0947b4a55505249
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fefac2bb246d910afeeccbe1a593a7ebd7c33f91abe53e1940d60997105343ff981e5da4dec4a7d02952bcfea9c6d1c8b24470a37245e40b226c2487202b26ae
|
7
|
+
data.tar.gz: cf89f28d5667988d4c9e791cb32c5aa3388c8db7d185db28517d02b2e1aa89c7939bbc29260152040a565813b3d4b64c46bdabfc29eda33529ba9e7c231a510b
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
easy_start (0.1.3)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.3)
|
10
|
+
rake (10.5.0)
|
11
|
+
rspec (3.7.0)
|
12
|
+
rspec-core (~> 3.7.0)
|
13
|
+
rspec-expectations (~> 3.7.0)
|
14
|
+
rspec-mocks (~> 3.7.0)
|
15
|
+
rspec-core (3.7.1)
|
16
|
+
rspec-support (~> 3.7.0)
|
17
|
+
rspec-expectations (3.7.0)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.7.0)
|
20
|
+
rspec-mocks (3.7.0)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.7.0)
|
23
|
+
rspec-support (3.7.1)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
bundler (~> 1.16)
|
30
|
+
easy_start!
|
31
|
+
rake (~> 10.0)
|
32
|
+
rspec (~> 3.0)
|
33
|
+
|
34
|
+
BUNDLED WITH
|
35
|
+
1.16.0
|
data/README.md
CHANGED
@@ -1,9 +1,19 @@
|
|
1
1
|
# EasyStart
|
2
2
|
|
3
|
-
EasyStart will allow users to
|
3
|
+
EasyStart will allow users to run certain rails commands (mainly used in local development environment) related to a application from anywhere in terminal.
|
4
|
+
User need not change directory to the application root for running commands like `rails s` , `rails c` etc.
|
5
|
+
Just adding the application path and application name to the meta data is required to use this gem.
|
6
|
+
|
7
|
+
After adding the meta data, you can launch the application from anywhere in the terminal by running the following command
|
4
8
|
|
5
9
|
$ easy_start application_name
|
6
|
-
|
10
|
+
|
11
|
+
This will start the rails server on port 3000.
|
12
|
+
|
13
|
+
EasyStart also supports switching branches, mentioning the port, opening rails console.
|
14
|
+
|
15
|
+
Add multiple projects and start their server or access their console with single command.
|
16
|
+
|
7
17
|
|
8
18
|
## Installation
|
9
19
|
|
@@ -19,11 +29,31 @@ Now you are ready to start your project from anywhere in terminal by
|
|
19
29
|
|
20
30
|
$ easy_start application_name
|
21
31
|
|
32
|
+
or
|
33
|
+
|
34
|
+
$ easy_start -l application_name
|
35
|
+
|
22
36
|
Switching branches are also supported by EasyStart
|
23
37
|
|
24
38
|
$ easy_start application_name branch_name
|
25
39
|
|
26
|
-
|
40
|
+
or
|
41
|
+
|
42
|
+
$ easy_start -l application_name -b branch_name
|
43
|
+
|
44
|
+
Note: mentioning branch name will switch the application directory to that branch and will automatically pull the latest version of the branch before starting the server( the branch should be available locally for it to work as expected).
|
45
|
+
|
46
|
+
Mentioning the port to be used by the server
|
47
|
+
|
48
|
+
$ easy_start -l application_name -P 4000
|
49
|
+
|
50
|
+
By default application will run on port 3000.
|
51
|
+
|
52
|
+
Opening rails console
|
53
|
+
|
54
|
+
$ easy_start -c application_name
|
55
|
+
|
56
|
+
|
27
57
|
|
28
58
|
## Development
|
29
59
|
|
data/bin/easy_start
CHANGED
@@ -15,10 +15,36 @@ OptionParser.new do |opts|
|
|
15
15
|
opts.on('-p', '--path path', 'path, should be mentioned after -a') do |path|
|
16
16
|
options['project_path'] = path;
|
17
17
|
end
|
18
|
+
|
19
|
+
opts.on('-l', '--launch launch', 'launch, mention application_name') do |name|
|
20
|
+
options['launch_project_name'] = name;
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.on('-b', '--branch branch', 'branch, should be mentioned after application_name') do |branch|
|
24
|
+
options['project_branch'] = branch;
|
25
|
+
end
|
26
|
+
|
27
|
+
opts.on('-P', '--port port', 'port, should be mentioned after application_name') do |port|
|
28
|
+
options['project_port'] = port;
|
29
|
+
end
|
30
|
+
|
31
|
+
opts.on('-c', '--console console', 'console, mention application_name for launching console') do |console_name|
|
32
|
+
options['console_project_name'] = console_name;
|
33
|
+
end
|
34
|
+
|
18
35
|
end.parse!
|
19
36
|
|
20
37
|
if options.present?
|
21
|
-
|
38
|
+
case
|
39
|
+
when options['project_name'].present?
|
40
|
+
EasyStart.add(options)
|
41
|
+
when options['launch_project_name'].present?
|
42
|
+
EasyStart.launch(options)
|
43
|
+
when options['console_project_name'].present?
|
44
|
+
EasyStart.launch_console(options['console_project_name'])
|
45
|
+
else
|
46
|
+
puts 'Format provided incorrect!!'
|
47
|
+
end
|
22
48
|
else
|
23
49
|
EasyStart.launch(ARGV[0],ARGV[1])
|
24
50
|
end
|
Binary file
|
data/lib/easy_start.rb
CHANGED
@@ -32,10 +32,13 @@ module EasyStart
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
def self.launch(
|
35
|
+
def self.launch(launch_data,branch='')
|
36
|
+
name = launch_data.respond_to?(:keys) ? launch_data['launch_project_name'] : launch_data
|
37
|
+
port = launch_data['project_port'] || '3000'
|
38
|
+
branch = launch_data['project_branch'] || branch
|
36
39
|
begin
|
37
40
|
file_path = File.join(File.dirname(__FILE__), "../scripts/#{name}.sh")
|
38
|
-
a = system "#{file_path}",(branch || '')
|
41
|
+
a = system "#{file_path}", port ,(branch || '')
|
39
42
|
rescue SystemExit, Interrupt
|
40
43
|
exit 0
|
41
44
|
rescue Exception => e
|
@@ -43,7 +46,27 @@ module EasyStart
|
|
43
46
|
end
|
44
47
|
end
|
45
48
|
|
49
|
+
def self.launch_console(name)
|
50
|
+
root_path = get_root_path(name)
|
51
|
+
system "cd #{root_path} && rails c"
|
52
|
+
end
|
53
|
+
|
46
54
|
def self.meta_data
|
47
|
-
['cd "$ROOT_PATH"','if [ -n "$
|
55
|
+
['cd "$ROOT_PATH"','if [ -n "$2" ]; then','git checkout $2','git pull','fi','rails s -p $1'].join("\n")
|
48
56
|
end
|
57
|
+
|
58
|
+
def self.get_root_path(name)
|
59
|
+
root_path = ""
|
60
|
+
file_path = File.join(File.dirname(__FILE__), "../scripts/#{name}.sh")
|
61
|
+
File.open(file_path).each do |line|
|
62
|
+
if line.include? 'ROOT_PATH='
|
63
|
+
line.slice!("ROOT_PATH=\"")
|
64
|
+
line.slice!("\"\n")
|
65
|
+
root_path = line
|
66
|
+
break
|
67
|
+
end
|
68
|
+
end
|
69
|
+
root_path
|
70
|
+
end
|
71
|
+
|
49
72
|
end
|
data/lib/easy_start/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_start
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arun Eapachen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- ".rspec"
|
66
66
|
- ".travis.yml"
|
67
67
|
- Gemfile
|
68
|
+
- Gemfile.lock
|
68
69
|
- LICENSE.txt
|
69
70
|
- README.md
|
70
71
|
- Rakefile
|
@@ -73,6 +74,7 @@ files:
|
|
73
74
|
- bin/setup
|
74
75
|
- easy_start-0.1.0.gem
|
75
76
|
- easy_start-0.1.1.gem
|
77
|
+
- easy_start-0.1.2.gem
|
76
78
|
- easy_start.gemspec
|
77
79
|
- lib/easy_start.rb
|
78
80
|
- lib/easy_start/version.rb
|