rise-cli 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45bf66600ed73d3196237da7baf820fc7f5d70b0
4
- data.tar.gz: 829875b55c1c519238ce8a1cc11d094e9c5be679
3
+ metadata.gz: be2ded779e6eb515dec6f7a0a19a48c61b62b8d3
4
+ data.tar.gz: ca6c31875c60f74d5d7d32c27d9782d6ff116b7d
5
5
  SHA512:
6
- metadata.gz: 4eb1cfd3a0c32b6743f2fe5f641c44a29056ce3e747c9263cc45516f6eb5da15aca42b2bb6fb769c075699de0ef0d753ecb59e5e6c2d42306ab7ac538a3a26d0
7
- data.tar.gz: 7b588ad2f036ac8f1db48fa8b534c9cfea6ad6e16991ceb1d5099f9b4f924c9c10c159ea3efa8b3935077d80c7c63ee1f9283d48d9f3d75cc7ed32c0bc0a1a61
6
+ metadata.gz: 3b7e2c3c13155c08a19e6a2b2289d83f567e9482b4d2c5825b1665c0c191c2183929d88201accdfe007798f468e03d39b02bee6de2bdfd01eae9aff0deaec6d1
7
+ data.tar.gz: de0455fd745e927b93a3b2f1e05599a544cb9b0d2fa7058003e81420756da9fa93a9e9af1adc1863501c68fb1fbe0973dba9817a075317ef1545022c6c6007b1
data/.gitignore CHANGED
@@ -1,2 +1,2 @@
1
- # Old html files
2
- views
1
+ # Old html files
2
+ views
data/.travis.yml CHANGED
@@ -1,9 +1,9 @@
1
- language: ruby
2
- dist: trusty
3
- rvm:
4
- - 2.4
5
-
6
- script:
7
- - bundle && bundle install
8
- - bundle exec rspec
9
- - bundle exec rubocop --fail-level W
1
+ language: ruby
2
+ dist: trusty
3
+ rvm:
4
+ - 2.4
5
+
6
+ script:
7
+ - bundle && bundle install
8
+ - bundle exec rspec
9
+ - bundle exec rubocop --fail-level W
data/CONTRIBUTING.md CHANGED
@@ -1,27 +1,27 @@
1
- ## Thanks!
2
- Thank you for wanting to contribute to rise!
3
- If you want to contribute, there are a few guidelines that
4
- should generally be followed.
5
-
6
- ### How the contributing process goes
7
- 1. You create a pull request doing your best to follow the do's and dont's outlined below
8
- 2. I will review your code if it needs to be reviewed
9
- 3. If travis and codeclimate OK the changes, your code will be merged onto master and eventually shipped with the next gem release
10
-
11
- ### Code contributions
12
- * **Do** your best to stick to the [Ruby style guide]
13
- * **Do** follow the [50/72 rule] for Git commit messages.
14
- * **Do** make sure that there are no rubocop warnings on your new code (using `--fail-level W`)
15
-
16
- ### Pull Requests
17
- * **Do** have a clear, concise title
18
- * **Do** include as many details as possible in the pull request body
19
- * **Do** include console output (if applicable) in your pull request (asciinema if possible)
20
- * **Do** `require` your new file in `lib/core.rb` and place the file in `lib/core/`if you are adding new library code.
21
- * **Don't** leave your pull request descriptions blank.
22
- * **Don't** go radio silent on pull requests, try to reply fast so we can land your code quicker
23
- * **Dont't** get agitated if your request is not accepted.
24
-
25
-
26
- [Ruby style guide]:https://github.com/bbatsov/ruby-style-guide
27
- [50/72 rule]:http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
1
+ ## Thanks!
2
+ Thank you for wanting to contribute to rise!
3
+ If you want to contribute, there are a few guidelines that
4
+ should generally be followed.
5
+
6
+ ### How the contributing process goes
7
+ 1. You create a pull request doing your best to follow the do's and dont's outlined below
8
+ 2. I will review your code if it needs to be reviewed
9
+ 3. If travis and codeclimate OK the changes, your code will be merged onto master and eventually shipped with the next gem release
10
+
11
+ ### Code contributions
12
+ * **Do** your best to stick to the [Ruby style guide]
13
+ * **Do** follow the [50/72 rule] for Git commit messages.
14
+ * **Do** make sure that there are no rubocop warnings on your new code (using `--fail-level W`)
15
+
16
+ ### Pull Requests
17
+ * **Do** have a clear, concise title
18
+ * **Do** include as many details as possible in the pull request body
19
+ * **Do** include console output (if applicable) in your pull request (asciinema if possible)
20
+ * **Do** `require` your new file in `lib/core.rb` and place the file in `lib/core/`if you are adding new library code.
21
+ * **Don't** leave your pull request descriptions blank.
22
+ * **Don't** go radio silent on pull requests, try to reply fast so we can land your code quicker
23
+ * **Dont't** get agitated if your request is not accepted.
24
+
25
+
26
+ [Ruby style guide]:https://github.com/bbatsov/ruby-style-guide
27
+ [50/72 rule]:http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
data/Gemfile CHANGED
@@ -1,13 +1,13 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gem 'clipboard'
6
- gem 'http'
7
- gem 'os'
8
- gem 'paint'
9
- gem 'rex-text'
10
- gem 'rspec'
11
- gem 'rspec-core'
12
- gem 'rubocop'
13
- gem 'whirly'
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'clipboard'
6
+ gem 'http'
7
+ gem 'os'
8
+ gem 'paint'
9
+ gem 'rex-text'
10
+ gem 'rspec'
11
+ gem 'rspec-core'
12
+ gem 'rubocop'
13
+ gem 'whirly'
data/Gemfile.lock CHANGED
@@ -1,76 +1,76 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- addressable (2.5.2)
5
- public_suffix (>= 2.0.2, < 4.0)
6
- ast (2.3.0)
7
- clipboard (1.1.1)
8
- diff-lcs (1.3)
9
- domain_name (0.5.20170404)
10
- unf (>= 0.0.5, < 1.0.0)
11
- http (3.0.0)
12
- addressable (~> 2.3)
13
- http-cookie (~> 1.0)
14
- http-form_data (>= 2.0.0.pre.pre2, < 3)
15
- http_parser.rb (~> 0.6.0)
16
- http-cookie (1.0.3)
17
- domain_name (~> 0.5)
18
- http-form_data (2.0.0)
19
- http_parser.rb (0.6.0)
20
- os (1.0.0)
21
- paint (2.0.0)
22
- parallel (1.12.0)
23
- parser (2.4.0.0)
24
- ast (~> 2.2)
25
- powerpack (0.1.1)
26
- public_suffix (3.0.0)
27
- rainbow (2.2.2)
28
- rake
29
- rake (12.0.0)
30
- rex-text (0.2.15)
31
- rspec (3.6.0)
32
- rspec-core (~> 3.6.0)
33
- rspec-expectations (~> 3.6.0)
34
- rspec-mocks (~> 3.6.0)
35
- rspec-core (3.6.0)
36
- rspec-support (~> 3.6.0)
37
- rspec-expectations (3.6.0)
38
- diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.6.0)
40
- rspec-mocks (3.6.0)
41
- diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.6.0)
43
- rspec-support (3.6.0)
44
- rubocop (0.50.0)
45
- parallel (~> 1.10)
46
- parser (>= 2.3.3.1, < 3.0)
47
- powerpack (~> 0.1)
48
- rainbow (>= 2.2.2, < 3.0)
49
- ruby-progressbar (~> 1.7)
50
- unicode-display_width (~> 1.0, >= 1.0.1)
51
- ruby-progressbar (1.9.0)
52
- unf (0.1.4)
53
- unf_ext
54
- unf_ext (0.0.7.4)
55
- unf_ext (0.0.7.4-x64-mingw32)
56
- unicode-display_width (1.3.0)
57
- whirly (0.2.5)
58
- unicode-display_width (~> 1.1)
59
-
60
- PLATFORMS
61
- ruby
62
- x64-mingw32
63
-
64
- DEPENDENCIES
65
- clipboard
66
- http
67
- os
68
- paint
69
- rex-text
70
- rspec
71
- rspec-core
72
- rubocop
73
- whirly
74
-
75
- BUNDLED WITH
76
- 1.15.4
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.5.2)
5
+ public_suffix (>= 2.0.2, < 4.0)
6
+ ast (2.3.0)
7
+ clipboard (1.1.1)
8
+ diff-lcs (1.3)
9
+ domain_name (0.5.20170404)
10
+ unf (>= 0.0.5, < 1.0.0)
11
+ http (3.0.0)
12
+ addressable (~> 2.3)
13
+ http-cookie (~> 1.0)
14
+ http-form_data (>= 2.0.0.pre.pre2, < 3)
15
+ http_parser.rb (~> 0.6.0)
16
+ http-cookie (1.0.3)
17
+ domain_name (~> 0.5)
18
+ http-form_data (2.0.0)
19
+ http_parser.rb (0.6.0)
20
+ os (1.0.0)
21
+ paint (2.0.0)
22
+ parallel (1.12.0)
23
+ parser (2.4.0.0)
24
+ ast (~> 2.2)
25
+ powerpack (0.1.1)
26
+ public_suffix (3.0.0)
27
+ rainbow (2.2.2)
28
+ rake
29
+ rake (12.0.0)
30
+ rex-text (0.2.15)
31
+ rspec (3.6.0)
32
+ rspec-core (~> 3.6.0)
33
+ rspec-expectations (~> 3.6.0)
34
+ rspec-mocks (~> 3.6.0)
35
+ rspec-core (3.6.0)
36
+ rspec-support (~> 3.6.0)
37
+ rspec-expectations (3.6.0)
38
+ diff-lcs (>= 1.2.0, < 2.0)
39
+ rspec-support (~> 3.6.0)
40
+ rspec-mocks (3.6.0)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.6.0)
43
+ rspec-support (3.6.0)
44
+ rubocop (0.50.0)
45
+ parallel (~> 1.10)
46
+ parser (>= 2.3.3.1, < 3.0)
47
+ powerpack (~> 0.1)
48
+ rainbow (>= 2.2.2, < 3.0)
49
+ ruby-progressbar (~> 1.7)
50
+ unicode-display_width (~> 1.0, >= 1.0.1)
51
+ ruby-progressbar (1.9.0)
52
+ unf (0.1.4)
53
+ unf_ext
54
+ unf_ext (0.0.7.4)
55
+ unf_ext (0.0.7.4-x64-mingw32)
56
+ unicode-display_width (1.3.0)
57
+ whirly (0.2.5)
58
+ unicode-display_width (~> 1.1)
59
+
60
+ PLATFORMS
61
+ ruby
62
+ x64-mingw32
63
+
64
+ DEPENDENCIES
65
+ clipboard
66
+ http
67
+ os
68
+ paint
69
+ rex-text
70
+ rspec
71
+ rspec-core
72
+ rubocop
73
+ whirly
74
+
75
+ BUNDLED WITH
76
+ 1.15.4
data/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2017 Carter Brainerd
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 all
13
- 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 THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Carter Brainerd
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,63 +1,63 @@
1
- ![rise](https://github.com/cbrnrd/rise/raw/master/img/rise_logo.png)
2
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3
- [![Code Climate](https://img.shields.io/codeclimate/github/cbrnrd/rise.svg?style=flat-square)](https://codeclimate.com/github/cbrnrd/rise)
4
- [![Build Status](https://img.shields.io/travis/cbrnrd/rise.svg?style=flat-square)](https://travis-ci.org/cbrnrd/rise)
5
- [![Gem](https://img.shields.io/gem/v/rise-cli.svg?style=flat-square)](https://rubygems.org/gems/rise-cli)
6
- [![Gem](https://img.shields.io/gem/dt/rise-cli.svg?style=flat-square)](https://rubygems.org/gems/rise-cli)
7
- [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/cbrnrd/rise/blob/master/LICENSE)
8
-
9
- # Usage
10
-
11
- Using rise is simple, just run the `rise` command
12
-
13
- [![asciicast](https://asciinema.org/a/Z7aigs1yAaqJWYqL1fQaqv9yt.png)](https://asciinema.org/a/Z7aigs1yAaqJWYqL1fQaqv9yt)
14
-
15
- ## Installing
16
-
17
- In order to get rise up and running, there's 2 ways you can install it.
18
-
19
- 1. Download the gem
20
-
21
- ```
22
- gem install rise-cli
23
- ```
24
-
25
- 2. Build from source
26
-
27
- ```
28
- $ git clone https://github.com/cbrnrd/rise
29
- $ bundle install
30
- ```
31
-
32
- ## Built With
33
-
34
- - [RubyGems](https://rubygems.org) - the Ruby community's gem hosting service
35
- - [Atom](https://atom.io/) - A hackable text editor for the 21st Century
36
- - [DigitalOcean](https://digitalocean.com) - Used for server hosting
37
-
38
- ## Contributing
39
-
40
- Please read [CONTRIBUTING.md](https://github.com/cbrnrd/rise/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting a pull requests.
41
-
42
- ## Features
43
- - No need to install git, svn, or any other version control software.
44
- - No complex cloud setup
45
- - Extremely fast upload speeds
46
- - Unlimited unique URL's
47
- - No manual setup of websites
48
- - Your services are always served over a secure connection
49
- - Open source so that you can know exactly what code is runnning on your computer.
50
-
51
- ## Coming soon
52
- - gzip file transfer
53
- - actual use of the password hash for secure uploads
54
-
55
- ## Authors
56
-
57
- - **Carter Brainerd** - [Website](https://carterbrainerd.me)
58
-
59
- See also the list of [contributors](https://github.com/cbrnrd/rise/contributors) who participated in this project.
60
-
61
- ## License
62
-
63
- This project is licensed under the MIT License - see the [LICENSE](https://github.com/cbrnrd/rise/blob/master/LICENSE) file for details
1
+ ![rise](https://github.com/cbrnrd/rise/raw/master/img/rise_logo.png)
2
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
3
+ [![Code Climate](https://img.shields.io/codeclimate/github/cbrnrd/rise.svg?style=flat-square)](https://codeclimate.com/github/cbrnrd/rise)
4
+ [![Build Status](https://img.shields.io/travis/cbrnrd/rise.svg?style=flat-square)](https://travis-ci.org/cbrnrd/rise)
5
+ [![Gem](https://img.shields.io/gem/v/rise-cli.svg?style=flat-square)](https://rubygems.org/gems/rise-cli)
6
+ [![Gem](https://img.shields.io/gem/dt/rise-cli.svg?style=flat-square)](https://rubygems.org/gems/rise-cli)
7
+ [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/cbrnrd/rise/blob/master/LICENSE)
8
+
9
+ # Usage
10
+
11
+ Using rise is simple, just run the `rise` command
12
+
13
+ [![asciicast](https://asciinema.org/a/Z7aigs1yAaqJWYqL1fQaqv9yt.png)](https://asciinema.org/a/Z7aigs1yAaqJWYqL1fQaqv9yt)
14
+
15
+ ## Installing
16
+
17
+ In order to get rise up and running, there's 2 ways you can install it.
18
+
19
+ 1. Download the gem
20
+
21
+ ```
22
+ gem install rise-cli
23
+ ```
24
+
25
+ 2. Build from source
26
+
27
+ ```
28
+ $ git clone https://github.com/cbrnrd/rise
29
+ $ bundle install
30
+ ```
31
+
32
+ ## Built With
33
+
34
+ - [RubyGems](https://rubygems.org) - the Ruby community's gem hosting service
35
+ - [Atom](https://atom.io/) - A hackable text editor for the 21st Century
36
+ - [DigitalOcean](https://digitalocean.com) - Used for server hosting
37
+
38
+ ## Contributing
39
+
40
+ Please read [CONTRIBUTING.md](https://github.com/cbrnrd/rise/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting a pull requests.
41
+
42
+ ## Features
43
+ - No need to install git, svn, or any other version control software.
44
+ - No complex cloud setup
45
+ - Extremely fast upload speeds
46
+ - Unlimited unique URL's
47
+ - No manual setup of websites
48
+ - Your services are always served over a secure connection
49
+ - Open source so that you can know exactly what code is runnning on your computer.
50
+
51
+ ## Coming soon
52
+ - gzip file transfer
53
+ - actual use of the password hash for secure uploads
54
+
55
+ ## Authors
56
+
57
+ - **Carter Brainerd** - [Website](https://carterbrainerd.me)
58
+
59
+ See also the list of [contributors](https://github.com/cbrnrd/rise/contributors) who participated in this project.
60
+
61
+ ## License
62
+
63
+ This project is licensed under the MIT License - see the [LICENSE](https://github.com/cbrnrd/rise/blob/master/LICENSE) file for details
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task default: :spec
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
data/TODO.txt CHANGED
@@ -1,5 +1,5 @@
1
- TODO things for rise:
2
- * FIX THE DAMN AUTH ARCHITECTURE SO IT WORKS DAMN IT
3
- * Add a .keyfile to each upload containing a private key. This file will be used to make sure that the same uuid can't be uploaded to twice and for a future file deletion method.
4
- * Add said file deletion method
5
- * Add GZIP file uploads
1
+ TODO things for rise:
2
+ * FIX THE DAMN AUTH ARCHITECTURE SO IT WORKS DAMN IT
3
+ * Add a .keyfile to each upload containing a private key. This file will be used to make sure that the same uuid can't be uploaded to twice and for a future file deletion method.
4
+ * Add said file deletion method
5
+ * Add GZIP file uploads
data/bin/console CHANGED
@@ -1,14 +1,14 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "rise"
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__)
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rise"
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/rise CHANGED
@@ -1,70 +1,70 @@
1
- #!/usr/bin/env ruby
2
-
3
- # TODO
4
- # => Try to fix spinner bug on Windows (may be a weird interaction with \r)
5
-
6
- require 'core'
7
-
8
- options = {}
9
- options[:open] = false
10
- OptionParser.new do |opts|
11
- opts.banner = "Usage: #{$PROGRAM_NAME} [options]\nRise version: #{Rise::Constants::VERSION}"
12
- opts.separator Paint["\nGeneral Options: ", '#95a5a6']
13
-
14
- opts.on('--version', 'Show the rise version and exit') do
15
- puts "Rise version: #{Paint[Rise::Constants::VERSION, '#2ecc71']}"
16
- exit 0
17
- end
18
-
19
- opts.on('-v', '--verbose', 'Run verbosely') do |v|
20
- options[:verbose] = v
21
- end
22
- # directory flag
23
- opts.on('-d DIR', '--dir DIR', String, 'Upload files in DIR') do |d|
24
- options[:directory] = d unless d.nil?
25
- end
26
-
27
- opts.on('-u', '--update', 'Check if rise has a newer version and install it') do
28
- Rise::Util.check_for_update!
29
- exit 0
30
- end
31
-
32
- opts.on('-o', '--open', 'Open the deployment in a browser if possible') do
33
- options[:open] = true
34
- end
35
-
36
- opts.on('-h', '--help', 'Show this help message') do
37
- puts opts
38
- exit
39
- end
40
- end.parse!(ARGV)
41
-
42
- if Rise::Util.first_run?
43
- Rise::Util.setup
44
- puts "\nPlease run the `rise` command again to upload your files."
45
- exit 0
46
- end
47
- Rise::Util.check_for_update!
48
- result_url = ''
49
- uploader = Rise::Transport::Uploader.new(options[:directory] || Dir.pwd)
50
-
51
- if uploader.total_files_size > 52428800
52
- puts Paint["Max file size reached (#{uploader.total_files_size} > 50MB)", '#FF0000']
53
- exit 0
54
- end
55
-
56
- puts Paint['Thanks for using Rise! Your local source for serverless deployment!', '#95a5a6']
57
-
58
- Whirly.start(spinner: 'dots', status: "Uploading files (#{uploader.total_files} total files)") do
59
- beginning_time = Time.now
60
- result_url = uploader.upload!(options[:verbose]) # Do the file upload
61
-
62
- Whirly.status = 'Done!\n'
63
- Clipboard.copy(result_url)
64
- print Paint["Your url is: #{result_url} (copied to clipboard) ", :bold]
65
- puts Paint["[#{((Time.now - beginning_time)).round(2)}s]", '#95a5a6']
66
-
67
- puts Paint['Deployment successful!', '#3498db']
68
-
69
- Rise::Util.open_deployment_in_browser(result_url) if options[:open]
70
- end
1
+ #!/usr/bin/env ruby
2
+
3
+ # TODO
4
+ # => Try to fix spinner bug on Windows (may be a weird interaction with \r)
5
+
6
+ require 'core'
7
+
8
+ options = {}
9
+ options[:open] = false
10
+ OptionParser.new do |opts|
11
+ opts.banner = "Usage: #{$PROGRAM_NAME} [options]\nRise version: #{Rise::Constants::VERSION}"
12
+ opts.separator Paint["\nGeneral Options: ", '#95a5a6']
13
+
14
+ opts.on('--version', 'Show the rise version and exit') do
15
+ puts "Rise version: #{Paint[Rise::Constants::VERSION, '#2ecc71']}"
16
+ exit 0
17
+ end
18
+
19
+ opts.on('-v', '--verbose', 'Run verbosely') do |v|
20
+ options[:verbose] = v
21
+ end
22
+ # directory flag
23
+ opts.on('-d DIR', '--dir DIR', String, 'Upload files in DIR') do |d|
24
+ options[:directory] = d unless d.nil?
25
+ end
26
+
27
+ opts.on('-u', '--update', 'Check if rise has a newer version and install it') do
28
+ Rise::Util.check_for_update!
29
+ exit 0
30
+ end
31
+
32
+ opts.on('-o', '--open', 'Open the deployment in a browser if possible') do
33
+ options[:open] = true
34
+ end
35
+
36
+ opts.on('-h', '--help', 'Show this help message') do
37
+ puts opts
38
+ exit
39
+ end
40
+ end.parse!(ARGV)
41
+
42
+ if Rise::Util.first_run?
43
+ Rise::Util.setup
44
+ puts "\nPlease run the `rise` command again to upload your files."
45
+ exit 0
46
+ end
47
+ Rise::Util.check_for_update!
48
+ result_url = ''
49
+ uploader = Rise::Transport::Uploader.new(options[:directory] || Dir.pwd)
50
+
51
+ if uploader.total_files_size > 52428800
52
+ puts Paint["Max file size reached (#{uploader.total_files_size} > 50MB)", '#FF0000']
53
+ exit 0
54
+ end
55
+
56
+ puts Paint['Thanks for using Rise! Your local source for serverless deployment!', '#95a5a6']
57
+
58
+ Whirly.start(spinner: 'dots', status: "Uploading files (#{uploader.total_files} total files)") do
59
+ beginning_time = Time.now
60
+ result_url = uploader.upload!(options[:verbose]) # Do the file upload
61
+
62
+ Whirly.status = "Done!\n"
63
+ Clipboard.copy(result_url)
64
+ print Paint["Your url is: #{result_url} (copied to clipboard) ", :bold]
65
+ puts Paint["[#{((Time.now - beginning_time)).round(2)}s]", '#95a5a6']
66
+
67
+ puts Paint['Deployment successful!', '#3498db']
68
+
69
+ Rise::Util.open_deployment_in_browser(result_url) if options[:open]
70
+ end
data/bin/setup CHANGED
File without changes
@@ -1,17 +1,17 @@
1
- RISE_DATA_DIR = File.join(Dir.home, '.rise')
2
- DOMAIN = 'rise.sh'.freeze
3
- AUTH_PORT = 4567
4
- UPLOAD_PORT = 8080
5
-
6
- module Rise
7
- #
8
- # Holds constants used throughout the framework
9
- #
10
- module Constants
11
- VERSION = '0.2.0'.freeze
12
- EMAIL = '0xCB@protonmail.com'.freeze
13
- AUTHORS = ['Carter Brainerd']
14
- NAME = 'rise-cli'.freeze
15
- RISE_DIR = File.join(File.dirname(__FILE__), '..', '..')
16
- end
17
- end
1
+ RISE_DATA_DIR = File.join(Dir.home, '.rise')
2
+ DOMAIN = 'rise.sh'.freeze
3
+ AUTH_PORT = 4567
4
+ UPLOAD_PORT = 8080
5
+
6
+ module Rise
7
+ #
8
+ # Holds constants used throughout the framework
9
+ #
10
+ module Constants
11
+ VERSION = '0.2.1'.freeze
12
+ EMAIL = '0xCB@protonmail.com'.freeze
13
+ AUTHORS = ['Carter Brainerd']
14
+ NAME = 'rise-cli'.freeze
15
+ RISE_DIR = File.join(File.dirname(__FILE__), '..', '..')
16
+ end
17
+ end
@@ -1,61 +1,61 @@
1
- require 'rex/text'
2
- require 'uri'
3
- require 'json'
4
- require 'http'
5
-
6
- module Rise
7
- #
8
- # Handles all communication with the rise upload server
9
- #
10
- module Transport
11
- # Handles uploading files
12
- class Uploader
13
- attr_reader :folder_path, :total_files, :include_folder
14
- attr_reader :uuid, :current_file, :total_files_size
15
- attr_accessor :files
16
-
17
- def initialize(folder_path, include_folder = true)
18
- @folder_path = folder_path
19
- @files = Dir.glob("#{File.absolute_path(folder_path)}/**/*")
20
- @total_files = @files.length
21
- @total_files_size = calculate_files_size
22
- @include_folder = include_folder
23
- @uuid = "#{File.basename(File.absolute_path(folder_path))}-#{Rex::Text.rand_text_alphanumeric(8)}" # Structure: foldername-8RNDLTRS
24
- end
25
-
26
- #
27
- # Uploads the files from +folder_path+ to the upload server
28
- # @return String the final URL of the uploaded contents
29
- #
30
- def upload!(*)
31
- upload_uri_base = "http://rise.sh:8080/api/v1/#{@uuid}"
32
- access_uri = "https://rise.sh/#{@uuid}"
33
- uri = ''
34
-
35
- # This sorts the files by (file path) length.
36
- # It is supposed to make the server make the first layer of files
37
- # before the rest of the layers.
38
- ordered_files = files.sort_by(&:length)
39
- ordered_files.each do |f|
40
- isdir = File.directory?(f)
41
- final_path = File.absolute_path(f).gsub(
42
- File.expand_path(folder_path), '')
43
- uri = URI.parse("#{upload_uri_base}/#{final_path}?dir=#{isdir}")
44
- begin
45
- HTTP.put(uri.to_s, body: File.read(f))
46
- rescue Errno::EISDIR
47
- HTTP.put(uri.to_s, body: '')
48
- next
49
- end
50
- end
51
- access_uri
52
- end
53
-
54
- protected
55
-
56
- def calculate_files_size
57
- @files.inject(0){|sum, file| sum + File.size(file)}
58
- end
59
- end
60
- end
61
- end
1
+ require 'rex/text'
2
+ require 'uri'
3
+ require 'json'
4
+ require 'http'
5
+
6
+ module Rise
7
+ #
8
+ # Handles all communication with the rise upload server
9
+ #
10
+ module Transport
11
+ # Handles uploading files
12
+ class Uploader
13
+ attr_reader :folder_path, :total_files, :include_folder
14
+ attr_reader :uuid, :current_file, :total_files_size
15
+ attr_accessor :files
16
+
17
+ def initialize(folder_path, include_folder = true)
18
+ @folder_path = folder_path
19
+ @files = Dir.glob("#{File.absolute_path(folder_path)}/**/*")
20
+ @total_files = @files.length
21
+ @total_files_size = calculate_files_size
22
+ @include_folder = include_folder
23
+ @uuid = "#{File.basename(File.absolute_path(folder_path))}-#{Rex::Text.rand_text_alphanumeric(8)}" # Structure: foldername-8RNDLTRS
24
+ end
25
+
26
+ #
27
+ # Uploads the files from +folder_path+ to the upload server
28
+ # @return String the final URL of the uploaded contents
29
+ #
30
+ def upload!(*)
31
+ upload_uri_base = "http://rise.sh:8080/api/v1/#{@uuid}"
32
+ access_uri = "https://rise.sh/#{@uuid}"
33
+ uri = ''
34
+
35
+ # This sorts the files by (file path) length.
36
+ # It is supposed to make the server make the first layer of files
37
+ # before the rest of the layers.
38
+ ordered_files = files.sort_by(&:length)
39
+ ordered_files.each do |f|
40
+ isdir = File.directory?(f)
41
+ final_path = File.absolute_path(f).gsub(
42
+ File.expand_path(folder_path), '')
43
+ uri = URI.parse("#{upload_uri_base}/#{final_path}?dir=#{isdir}")
44
+ begin
45
+ HTTP.put(uri.to_s, body: File.read(f))
46
+ rescue Errno::EISDIR
47
+ HTTP.put(uri.to_s, body: '')
48
+ next
49
+ end
50
+ end
51
+ access_uri
52
+ end
53
+
54
+ protected
55
+
56
+ def calculate_files_size
57
+ @files.inject(0){|sum, file| sum + File.size(file)}
58
+ end
59
+ end
60
+ end
61
+ end
data/lib/core/util.rb CHANGED
@@ -1,113 +1,109 @@
1
- require 'fileutils'
2
- require 'paint'
3
- require 'json'
4
- require 'http'
5
- require 'digest'
6
- require 'io/console'
7
- require 'whirly'
8
- require 'os'
9
- require 'json'
10
- require_relative 'constants'
11
-
12
- module Rise
13
- #
14
- # Utility methods
15
- #
16
- module Util
17
- #
18
- # Checks if rise is being run for the first time
19
- #
20
- def self.first_run?
21
- !File.directory?(File.join(Dir.home, '.rise'))
22
- end
23
-
24
- #
25
- # Check for a new version of the gem
26
- #
27
- def self.check_for_update!
28
- src = git_or_gem
29
- begin
30
- if src == 2 # if the gem was downloaded from rubygems
31
- current_version = JSON.parse(HTTP.get('https://rubygems.org/api/v1/versions/rise-cli/latest.json'))['version']
32
- if current_version != Rise::Constants::VERSION
33
- Whirly.start(
34
- spinner: 'line',
35
- status: "New version available (#{Paint[Rise::Constants::VERSION, 'red']} -> #{Paint[current_version, '#3498db']}), updating..."
36
- ) do
37
- system("gem uninstall rise-cli -v #{Rise::Constants::VERSION} > /dev/null")
38
- system("gem install rise-cli > /dev/null")
39
- puts Paint["Update complete, just run #{Paint['`rise`', '#3498db']} to deploy"]
40
- end
41
- end
42
- elsif src == 1
43
- if `git log HEAD..origin/master --oneline` != ''
44
- puts "It seems you're on bleeding edge, fetching new changes..."
45
- vputs("Updating from #{`git show --no-color --oneline -s`.split(' ')[0]} to #{`git rev-parse --short HEAD`}")
46
- `git pull`
47
- puts Paint["Update complete, just run #{Paint['`rise`', '#3498db']} to deploy"]
48
- end
49
- end
50
- rescue StandardError => e
51
- puts "Unable to check for updates. Error: #{Paint[e.message, 'red']}"
52
- exit 1
53
- end
54
- end
55
-
56
- #
57
- # Creates all of the necessary files and login information
58
- #
59
- def self.setup
60
- puts Paint['Detected first time run, creating necessary files...', :blue]
61
- FileUtils.mkdir(RISE_DATA_DIR)
62
- FileUtils.mkdir(File.join(RISE_DATA_DIR, 'auth'))
63
-
64
- # TODO: Reimplement when the backend server actually works
65
- # Get the input from the user
66
- # print Paint['1. Log in\n2. Sign up\n > ', :bold]
67
- # while (choice = gets.chomp!)
68
- # if choice == '1'
69
- # login
70
- # break
71
- # elsif choice == '2'
72
- # signup
73
- # break
74
- # else
75
- # puts Paint['Please type `1` or `2`', :red]
76
- # next
77
- # end
78
- # end
79
- end
80
-
81
- #
82
- # Opens +url+ in a web browser if possible
83
- #
84
- def self.open_deployment_in_browser(url)
85
- if OS.windows?
86
- system("START \"\" \"#{url}\"")
87
- else
88
- system("open #{url}")
89
- end
90
- end
91
-
92
-
93
-
94
- protected
95
- #
96
- # 1 = git, 2 = gem, 3 = unknown
97
- #
98
- def git_or_gem
99
- gem = nil
100
- 1 if File.exist?(File.join(Rise::Constants::VERSION, '.git'))
101
- if OS.windows?
102
- gem = system('which gem > NUL')
103
- else
104
- gem = system('which gem > /dev/null')
105
- end
106
-
107
- 2 if gem == true
108
- 3
109
- end
110
-
111
-
112
- end
113
- end
1
+ require 'fileutils'
2
+ require 'paint'
3
+ require 'json'
4
+ require 'http'
5
+ require 'digest'
6
+ require 'io/console'
7
+ require 'whirly'
8
+ require 'os'
9
+ require 'json'
10
+ require_relative 'constants'
11
+
12
+ module Rise
13
+ #
14
+ # Utility methods
15
+ #
16
+ module Util
17
+ #
18
+ # Checks if rise is being run for the first time
19
+ #
20
+ def self.first_run?
21
+ !File.directory?(File.join(Dir.home, '.rise'))
22
+ end
23
+
24
+ #
25
+ # 1 = git, 2 = gem, 3 = unknown
26
+ #
27
+ def self.git_or_gem
28
+ gem = nil
29
+ 1 if File.exist?(File.join(Rise::Constants::VERSION, '.git'))
30
+ if OS.windows?
31
+ gem = system('which gem > NUL')
32
+ else
33
+ gem = system('which gem > /dev/null')
34
+ end
35
+
36
+ 2 if gem == true
37
+ 3
38
+ end
39
+
40
+ #
41
+ # Check for a new version of the gem
42
+ #
43
+ def self.check_for_update!
44
+ src = Rise::Util.git_or_gem
45
+ begin
46
+ if src == 2 # if the gem was downloaded from rubygems
47
+ current_version = JSON.parse(HTTP.get('https://rubygems.org/api/v1/versions/rise-cli/latest.json'))['version']
48
+ if current_version != Rise::Constants::VERSION
49
+ Whirly.start(
50
+ spinner: 'line',
51
+ status: "New version available (#{Paint[Rise::Constants::VERSION, 'red']} -> #{Paint[current_version, '#3498db']}), updating..."
52
+ ) do
53
+ system("gem uninstall rise-cli -v #{Rise::Constants::VERSION} > /dev/null")
54
+ system("gem install rise-cli > /dev/null")
55
+ puts Paint["Update complete, just run #{Paint['`rise`', '#3498db']} to deploy"]
56
+ end
57
+ end
58
+ elsif src == 1
59
+ if `git log HEAD..origin/master --oneline` != ''
60
+ puts "It seems you're on bleeding edge, fetching new changes..."
61
+ vputs("Updating from #{`git show --no-color --oneline -s`.split(' ')[0]} to #{`git rev-parse --short HEAD`}")
62
+ `git pull`
63
+ puts Paint["Update complete, just run #{Paint['`rise`', '#3498db']} to deploy"]
64
+ end
65
+ end
66
+ rescue StandardError => e
67
+ puts "Unable to check for updates. Error: #{Paint[e.message, 'red']}"
68
+ exit 1
69
+ end
70
+ end
71
+
72
+ #
73
+ # Creates all of the necessary files and login information
74
+ #
75
+ def self.setup
76
+ puts Paint['Detected first time run, creating necessary files...', :blue]
77
+ FileUtils.mkdir(RISE_DATA_DIR)
78
+ FileUtils.mkdir(File.join(RISE_DATA_DIR, 'auth'))
79
+
80
+ # TODO: Reimplement when the backend server actually works
81
+ # Get the input from the user
82
+ # print Paint['1. Log in\n2. Sign up\n > ', :bold]
83
+ # while (choice = gets.chomp!)
84
+ # if choice == '1'
85
+ # login
86
+ # break
87
+ # elsif choice == '2'
88
+ # signup
89
+ # break
90
+ # else
91
+ # puts Paint['Please type `1` or `2`', :red]
92
+ # next
93
+ # end
94
+ # end
95
+ end
96
+
97
+ #
98
+ # Opens +url+ in a web browser if possible
99
+ #
100
+ def self.open_deployment_in_browser(url)
101
+ if OS.windows?
102
+ system("START \"\" \"#{url}\"")
103
+ else
104
+ system("open #{url}")
105
+ end
106
+ end
107
+
108
+ end
109
+ end
data/lib/core.rb CHANGED
@@ -1,9 +1,9 @@
1
- # Gems
2
- require 'clipboard'
3
- require 'rex/text'
4
- require 'optparse'
5
-
6
- # lib files
7
- require 'core/transport'
8
- require 'core/util'
9
- require 'core/constants'
1
+ # Gems
2
+ require 'clipboard'
3
+ require 'rex/text'
4
+ require 'optparse'
5
+
6
+ # lib files
7
+ require 'core/transport'
8
+ require 'core/util'
9
+ require 'core/constants'
data/rise-cli.gemspec CHANGED
@@ -1,24 +1,24 @@
1
- # Put all our core library files in the require path
2
- $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
3
- require 'core'
4
-
5
- Gem::Specification.new do |s|
6
- s.name = Rise::Constants::NAME
7
- s.version = Rise::Constants::VERSION
8
- s.executables = %w[rise setup console]
9
- s.date = Time.now.strftime('%Y-%m-%d')
10
- s.summary = 'Simple serverless website deployment'
11
- s.authors = Rise::Constants::AUTHORS
12
- s.email = Rise::Constants::EMAIL
13
- s.files = `git ls-files`.split($/).reject { |file|
14
- file =~ /^server|^spec|^pkg/
15
- }
16
- s.homepage = 'http://rubygems.org/gems/rise-cli'
17
- s.license = 'MIT'
18
-
19
- s.add_runtime_dependency 'clipboard'
20
- s.add_runtime_dependency 'http'
21
- s.add_runtime_dependency 'paint'
22
- s.add_runtime_dependency 'rex-text'
23
- s.add_runtime_dependency 'whirly'
24
- end
1
+ # Put all our core library files in the require path
2
+ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
3
+ require 'core'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = Rise::Constants::NAME
7
+ s.version = Rise::Constants::VERSION
8
+ s.executables = %w[rise setup console]
9
+ s.date = Time.now.strftime('%Y-%m-%d')
10
+ s.summary = 'Simple serverless website deployment'
11
+ s.authors = Rise::Constants::AUTHORS
12
+ s.email = Rise::Constants::EMAIL
13
+ s.files = `git ls-files`.split($/).reject { |file|
14
+ file =~ /^server|^spec|^pkg/
15
+ }
16
+ s.homepage = 'http://rubygems.org/gems/rise-cli'
17
+ s.license = 'MIT'
18
+
19
+ s.add_runtime_dependency 'clipboard'
20
+ s.add_runtime_dependency 'http'
21
+ s.add_runtime_dependency 'paint'
22
+ s.add_runtime_dependency 'rex-text'
23
+ s.add_runtime_dependency 'whirly'
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rise-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carter Brainerd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-20 00:00:00.000000000 Z
11
+ date: 2017-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.5.2
130
+ rubygems_version: 2.4.8
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Simple serverless website deployment