easy_start 0.1.1
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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +52 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/easy_start +24 -0
- data/bin/setup +8 -0
- data/easy_start.gemspec +31 -0
- data/lib/easy_start/version.rb +3 -0
- data/lib/easy_start.rb +49 -0
- metadata +101 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8a4e2d5ef701823d4d40e2bfa1090950a2798e46
|
4
|
+
data.tar.gz: ed8b8d6cbb1cd3c533f58a1816cbeb6533f2e855
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b15302e171e17b151c91ec2d54080a189f860cbd4bfcc71dc8ffd8fb790e840eb851e19f1deaabfabe56b5cd5f7462b17960098f2d6a8f5dd8c5f4441f946684
|
7
|
+
data.tar.gz: 755d0c049c7a3f3b7a8ccc45156cc69b86c1ad030d97cc0830cb2d81e1d8e98f7a42cb495c92d6eb71398e799356b4fb118af4d36c1133cc0e2c0b4c1337b478
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Arun Eapachen
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# EasyStart
|
2
|
+
|
3
|
+
EasyStart will allow users to quickly start the local rails server in a single command. This gem is intended to be used only in development mode.
|
4
|
+
|
5
|
+
$ easy_start project_name
|
6
|
+
the above command will start the rails server in your local machine and you are ready to go to your browser to test or develop your application.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'easy_start'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install easy_start
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
After installing the gem, add the projects that needs to be started by the following command
|
27
|
+
|
28
|
+
$ easy_start -a project_name -p project_path
|
29
|
+
|
30
|
+
Now you are ready to start your project from anywhere in terminal by
|
31
|
+
|
32
|
+
$ easy_start project_name
|
33
|
+
|
34
|
+
Switching branches are also supported by EasyStart
|
35
|
+
|
36
|
+
$ easy_start project_name branch_name
|
37
|
+
|
38
|
+
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.
|
39
|
+
|
40
|
+
## Development
|
41
|
+
|
42
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
43
|
+
|
44
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
45
|
+
|
46
|
+
## Contributing
|
47
|
+
|
48
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/easy_start.
|
49
|
+
|
50
|
+
## License
|
51
|
+
|
52
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "easy_start"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/easy_start
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'easy_start'
|
4
|
+
require 'optparse'
|
5
|
+
require 'active_support/all'
|
6
|
+
|
7
|
+
options = {}
|
8
|
+
OptionParser.new do |opts|
|
9
|
+
opts.banner = "Usage: easy_start [options]"
|
10
|
+
|
11
|
+
opts.on('-a', '--add add', 'Add new project') do |add|
|
12
|
+
options['project_name'] = add;
|
13
|
+
end
|
14
|
+
|
15
|
+
opts.on('-p', '--path path', 'path, should be mentioned after -a') do |path|
|
16
|
+
options['project_path'] = path;
|
17
|
+
end
|
18
|
+
end.parse!
|
19
|
+
|
20
|
+
if options.present?
|
21
|
+
EasyStart.add(options)
|
22
|
+
else
|
23
|
+
EasyStart.launch(ARGV[0],ARGV[1])
|
24
|
+
end
|
data/bin/setup
ADDED
data/easy_start.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "easy_start/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "easy_start"
|
8
|
+
spec.version = EasyStart::VERSION
|
9
|
+
spec.authors = ["Arun Eapachen"]
|
10
|
+
spec.email = ["aruneapachen@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Will launch the local rails server with a single command.}
|
13
|
+
spec.description = %q{In order to work as expected add projects beforehand and just launch the server in a single command}
|
14
|
+
spec.homepage = "https://github.com/aruneapachenmec"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
|
20
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
21
|
+
f.match(%r{^(test|spec|features)/})
|
22
|
+
end
|
23
|
+
spec.bindir = "bin"
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.executables << 'easy_start'
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
29
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
30
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
31
|
+
end
|
data/lib/easy_start.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require "easy_start/version"
|
2
|
+
require 'active_support/all'
|
3
|
+
|
4
|
+
module EasyStart
|
5
|
+
def self.add(project)
|
6
|
+
base_data = {'project_name' => '', 'project_path' => ''}
|
7
|
+
base_data.each do |key,value|
|
8
|
+
loop do
|
9
|
+
base_data[key] = project[key]
|
10
|
+
unless base_data[key].present?
|
11
|
+
puts "Enter #{key}"
|
12
|
+
input = gets.chomp
|
13
|
+
base_data[key] = input
|
14
|
+
end
|
15
|
+
break if base_data[key].present?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
create_script base_data
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.create_script base_data
|
22
|
+
create_directory_if_not_found
|
23
|
+
file_path = File.join(File.dirname(__FILE__), "../scripts/#{base_data['project_name']}.sh")
|
24
|
+
File.open(file_path, 'w') {|f| f.write("ROOT_PATH=\"#{base_data['project_path']}\"\n" + meta_data) }
|
25
|
+
system "chmod 755 #{file_path}"
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.create_directory_if_not_found
|
29
|
+
directory_path = File.join(File.dirname(__FILE__), "../scripts")
|
30
|
+
unless File.directory?(directory_path)
|
31
|
+
Dir.mkdir directory_path
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.launch(name,branch='')
|
36
|
+
begin
|
37
|
+
file_path = File.join(File.dirname(__FILE__), "../scripts/#{name}.sh")
|
38
|
+
a = system "#{file_path}",(branch || '')
|
39
|
+
rescue SystemExit, Interrupt
|
40
|
+
exit 0
|
41
|
+
rescue Exception => e
|
42
|
+
puts e
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.meta_data
|
47
|
+
['cd "$ROOT_PATH"','if [ -n "$1" ]; then','git checkout $1','git pull','fi','rails s'].join("\n")
|
48
|
+
end
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: easy_start
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Arun Eapachen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-02-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: In order to work as expected add projects beforehand and just launch
|
56
|
+
the server in a single command
|
57
|
+
email:
|
58
|
+
- aruneapachen@gmail.com
|
59
|
+
executables:
|
60
|
+
- easy_start
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- ".gitignore"
|
65
|
+
- ".rspec"
|
66
|
+
- ".travis.yml"
|
67
|
+
- Gemfile
|
68
|
+
- LICENSE.txt
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- bin/console
|
72
|
+
- bin/easy_start
|
73
|
+
- bin/setup
|
74
|
+
- easy_start.gemspec
|
75
|
+
- lib/easy_start.rb
|
76
|
+
- lib/easy_start/version.rb
|
77
|
+
homepage: https://github.com/aruneapachenmec
|
78
|
+
licenses:
|
79
|
+
- MIT
|
80
|
+
metadata: {}
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 2.6.14
|
98
|
+
signing_key:
|
99
|
+
specification_version: 4
|
100
|
+
summary: Will launch the local rails server with a single command.
|
101
|
+
test_files: []
|