rise-cli 0.1.7 → 0.1.8

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: d388afeca104cc2795a4b124033584c59e6e2d21
4
- data.tar.gz: 0eee79cafb98f3cdcfadfaff3def1b3f4d9f6f21
3
+ metadata.gz: 3673a0fd29cd81c55900a08b0587977c9c6546c5
4
+ data.tar.gz: 7c0887e128cc632a5a2ebb3b9a7326dafbb215ec
5
5
  SHA512:
6
- metadata.gz: de5ac24bcb194d75b971242c94a24326b3e590396e29e23aded7558e0fb5f729a9f459f558c714aa7419fb9af074766951a78dfdc441baf215a47c7b8c09a63c
7
- data.tar.gz: 22c48506472ce2b0c2f55351444ce2c0d2c3014f749802d0d7b9f3bc7c17f851203cb5fd569f3c94b1f08cfca0196da0b6de86fc07a3291aa07e8684514cae9f
6
+ metadata.gz: f352f11cc8d8ae7c82da7a08f75a44cf1e6221e4e5d0a89861e68065a004705486413d82b75fffde4bce38c7552d87a7277cfd73338d2ea20122eee8578fbf04
7
+ data.tar.gz: eacbf01cacbcbef172bf32efdf673c191f5fc8c6a10b78171290140b07dcb30f6c4acdd9fa445b5a9769c4baea5b09b17ae4fe6351c6a6b76df12fc56283b86e
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,26 +1,26 @@
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
-
24
-
25
- [Ruby style guide]:https://github.com/bbatsov/ruby-style-guide
26
- [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
+
24
+
25
+ [Ruby style guide]:https://github.com/bbatsov/ruby-style-guide
26
+ [50/72 rule]:http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
data/Gemfile CHANGED
@@ -1,11 +1,13 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gem 'clipboard'
6
- gem 'http'
7
- gem 'paint'
8
- gem 'rex-text'
9
- gem 'rspec'
10
- gem 'rubocop'
11
- gem 'whirly'
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'clipboard'
6
+ gem 'http'
7
+ gem 'paint'
8
+ gem 'rex-text'
9
+ gem 'rspec'
10
+ gem 'rspec-core'
11
+ gem 'http'
12
+ gem 'rubocop'
13
+ gem 'whirly'
data/Gemfile.lock CHANGED
@@ -1,73 +1,74 @@
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
- paint (2.0.0)
21
- parallel (1.12.0)
22
- parser (2.4.0.0)
23
- ast (~> 2.2)
24
- powerpack (0.1.1)
25
- public_suffix (3.0.0)
26
- rainbow (2.2.2)
27
- rake
28
- rake (12.0.0)
29
- rex-text (0.2.15)
30
- rspec (3.6.0)
31
- rspec-core (~> 3.6.0)
32
- rspec-expectations (~> 3.6.0)
33
- rspec-mocks (~> 3.6.0)
34
- rspec-core (3.6.0)
35
- rspec-support (~> 3.6.0)
36
- rspec-expectations (3.6.0)
37
- diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.6.0)
39
- rspec-mocks (3.6.0)
40
- diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.6.0)
42
- rspec-support (3.6.0)
43
- rubocop (0.50.0)
44
- parallel (~> 1.10)
45
- parser (>= 2.3.3.1, < 3.0)
46
- powerpack (~> 0.1)
47
- rainbow (>= 2.2.2, < 3.0)
48
- ruby-progressbar (~> 1.7)
49
- unicode-display_width (~> 1.0, >= 1.0.1)
50
- ruby-progressbar (1.9.0)
51
- unf (0.1.4)
52
- unf_ext
53
- unf_ext (0.0.7.4)
54
- unf_ext (0.0.7.4-x64-mingw32)
55
- unicode-display_width (1.3.0)
56
- whirly (0.2.5)
57
- unicode-display_width (~> 1.1)
58
-
59
- PLATFORMS
60
- ruby
61
- x64-mingw32
62
-
63
- DEPENDENCIES
64
- clipboard
65
- http
66
- paint
67
- rex-text
68
- rspec
69
- rubocop
70
- whirly
71
-
72
- BUNDLED WITH
73
- 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
+ paint (2.0.0)
21
+ parallel (1.12.0)
22
+ parser (2.4.0.0)
23
+ ast (~> 2.2)
24
+ powerpack (0.1.1)
25
+ public_suffix (3.0.0)
26
+ rainbow (2.2.2)
27
+ rake
28
+ rake (12.0.0)
29
+ rex-text (0.2.15)
30
+ rspec (3.6.0)
31
+ rspec-core (~> 3.6.0)
32
+ rspec-expectations (~> 3.6.0)
33
+ rspec-mocks (~> 3.6.0)
34
+ rspec-core (3.6.0)
35
+ rspec-support (~> 3.6.0)
36
+ rspec-expectations (3.6.0)
37
+ diff-lcs (>= 1.2.0, < 2.0)
38
+ rspec-support (~> 3.6.0)
39
+ rspec-mocks (3.6.0)
40
+ diff-lcs (>= 1.2.0, < 2.0)
41
+ rspec-support (~> 3.6.0)
42
+ rspec-support (3.6.0)
43
+ rubocop (0.50.0)
44
+ parallel (~> 1.10)
45
+ parser (>= 2.3.3.1, < 3.0)
46
+ powerpack (~> 0.1)
47
+ rainbow (>= 2.2.2, < 3.0)
48
+ ruby-progressbar (~> 1.7)
49
+ unicode-display_width (~> 1.0, >= 1.0.1)
50
+ ruby-progressbar (1.9.0)
51
+ unf (0.1.4)
52
+ unf_ext
53
+ unf_ext (0.0.7.4)
54
+ unf_ext (0.0.7.4-x64-mingw32)
55
+ unicode-display_width (1.3.0)
56
+ whirly (0.2.5)
57
+ unicode-display_width (~> 1.1)
58
+
59
+ PLATFORMS
60
+ ruby
61
+ x64-mingw32
62
+
63
+ DEPENDENCIES
64
+ clipboard
65
+ http
66
+ paint
67
+ rex-text
68
+ rspec
69
+ rspec-core
70
+ rubocop
71
+ whirly
72
+
73
+ BUNDLED WITH
74
+ 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,6 +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
- * Limit uploads to 50MB
6
- * 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,59 +1,63 @@
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
- OptionParser.new do |opts|
10
- opts.banner = "Usage: #{$PROGRAM_NAME} [options]"
11
- opts.separator Paint["\nGeneral Options: ", '#95a5a6']
12
-
13
- opts.on('--version', 'Show the rise version and exit') do
14
- puts "Rise version: #{Paint[Rise::Constants::VERSION, '#2ecc71']}"
15
- exit 0
16
- end
17
-
18
- opts.on('-v', '--verbose', 'Run verbosely') do |v|
19
- options[:verbose] = v
20
- end
21
- # directory flag
22
- opts.on('-d DIR', '--dir DIR', String, 'Upload files in DIR') do |d|
23
- options[:directory] = d unless d.nil?
24
- end
25
-
26
- opts.on('-u', '--update', 'Check if rise has a newer version and install it') do
27
- Rise::Util.check_for_update!
28
- exit 0
29
- end
30
-
31
- opts.on('-h', '--help', 'Show this help message') do
32
- puts opts
33
- exit
34
- end
35
- end.parse!(ARGV)
36
-
37
- if Rise::Util.first_run?
38
- Rise::Util.setup
39
- puts "\nPlease run the `rise` command again to upload your files."
40
- exit 0
41
- end
42
- Rise::Util.check_for_update!
43
- result_url = ''
44
- uploader = Rise::Transport::Uploader.new(options[:directory]) unless options[:directory].nil?
45
- uploader = Rise::Transport::Uploader.new(Dir.pwd) if options[:directory].nil?
46
-
47
- puts Paint['Thanks for using Rise! Your local source for serverless deployment!', '#95a5a6']
48
-
49
- Whirly.start(spinner: 'dots', status: "Uploading files (#{uploader.total_files} total files)") do
50
- beginning_time = Time.now
51
- result_url = uploader.upload!(options[:verbose]) # Do the file upload
52
-
53
- Whirly.status = 'Done!\n'
54
- Clipboard.copy(result_url)
55
- print Paint["Your url is: #{result_url} (copied to clipboard) ", :bold]
56
- puts Paint["[#{((Time.now - beginning_time)).round(2)}s]", '#95a5a6']
57
-
58
- puts Paint['Deployment successful!', '#3498db']
59
- 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
+ OptionParser.new do |opts|
10
+ opts.banner = "Usage: #{$PROGRAM_NAME} [options]"
11
+ opts.separator Paint["\nGeneral Options: ", '#95a5a6']
12
+
13
+ opts.on('--version', 'Show the rise version and exit') do
14
+ puts "Rise version: #{Paint[Rise::Constants::VERSION, '#2ecc71']}"
15
+ exit 0
16
+ end
17
+
18
+ opts.on('-v', '--verbose', 'Run verbosely') do |v|
19
+ options[:verbose] = v
20
+ end
21
+ # directory flag
22
+ opts.on('-d DIR', '--dir DIR', String, 'Upload files in DIR') do |d|
23
+ options[:directory] = d unless d.nil?
24
+ end
25
+
26
+ opts.on('-u', '--update', 'Check if rise has a newer version and install it') do
27
+ Rise::Util.check_for_update!
28
+ exit 0
29
+ end
30
+
31
+ opts.on('-h', '--help', 'Show this help message') do
32
+ puts opts
33
+ exit
34
+ end
35
+ end.parse!(ARGV)
36
+
37
+ if Rise::Util.first_run?
38
+ Rise::Util.setup
39
+ puts "\nPlease run the `rise` command again to upload your files."
40
+ exit 0
41
+ end
42
+ Rise::Util.check_for_update!
43
+ result_url = ''
44
+ uploader = Rise::Transport::Uploader.new(options[:directory] || Dir.pwd)
45
+
46
+ if uploader.total_files_size > 52428800
47
+ puts Paint["Max file size reached (#{uploader.total_files_size} > 50MB)", '#FF0000']
48
+ exit 0
49
+ end
50
+
51
+ puts Paint['Thanks for using Rise! Your local source for serverless deployment!', '#95a5a6']
52
+
53
+ Whirly.start(spinner: 'dots', status: "Uploading files (#{uploader.total_files} total files)") do
54
+ beginning_time = Time.now
55
+ result_url = uploader.upload!(options[:verbose]) # Do the file upload
56
+
57
+ Whirly.status = 'Done!\n'
58
+ Clipboard.copy(result_url)
59
+ print Paint["Your url is: #{result_url} (copied to clipboard) ", :bold]
60
+ puts Paint["[#{((Time.now - beginning_time)).round(2)}s]", '#95a5a6']
61
+
62
+ puts Paint['Deployment successful!', '#3498db']
63
+ end
data/bin/setup CHANGED
File without changes
@@ -1,16 +1,16 @@
1
- RISE_DATA_DIR = File.join(Dir.home, '.rise')
2
- DOMAIN = 'rise.sh'.freeze
3
- AUTH_PORT = 4567.freeze
4
- UPLOAD_PORT = 8080.freeze
5
-
6
- module Rise
7
- #
8
- # Holds constants used throughout the framework
9
- #
10
- module Constants
11
- VERSION = '0.1.7'
12
- EMAIL = '0xCB@protonmail.com'
13
- AUTHORS = ['Carter Brainerd']
14
- NAME = 'rise-cli'
15
- end
16
- end
1
+ RISE_DATA_DIR = File.join(Dir.home, '.rise')
2
+ DOMAIN = 'rise.sh'.freeze
3
+ AUTH_PORT = 4567.freeze
4
+ UPLOAD_PORT = 8080.freeze
5
+
6
+ module Rise
7
+ #
8
+ # Holds constants used throughout the framework
9
+ #
10
+ module Constants
11
+ VERSION = '0.1.8'
12
+ EMAIL = '0xCB@protonmail.com'
13
+ AUTHORS = ['Carter Brainerd']
14
+ NAME = 'rise-cli'
15
+ end
16
+ end
@@ -1,54 +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
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
- @include_folder = include_folder
22
- @uuid = "#{File.basename(File.absolute_path(folder_path))}-#{Rex::Text.rand_text_alphanumeric(8)}" # Structure: foldername-8RNDLTRS
23
- end
24
-
25
- #
26
- # Uploads the files from +folder_path+ to the upload server
27
- # @return String the final URL of the uploaded contents
28
- #
29
- def upload!(*)
30
- upload_uri_base = "http://rise.sh:8080/api/v1/#{@uuid}"
31
- access_uri = "https://rise.sh/#{@uuid}"
32
- uri = ''
33
-
34
- # This sorts the files by (file path) length.
35
- # It is supposed to make the server make the first layer of files
36
- # before the rest of the layers.
37
- ordered_files = files.sort_by(&:length)
38
- ordered_files.each do |f|
39
- isdir = File.directory?(f)
40
- final_path = File.absolute_path(f).gsub(
41
- File.expand_path(folder_path), '')
42
- uri = URI.parse("#{upload_uri_base}/#{final_path}?dir=#{isdir}")
43
- begin
44
- HTTP.put(uri.to_s, body: File.read(f))
45
- rescue Errno::EISDIR
46
- HTTP.put(uri.to_s, body: '')
47
- next
48
- end
49
- end
50
- access_uri
51
- end
52
- end
53
- end
54
- 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
+ private
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,75 +1,75 @@
1
- require 'fileutils'
2
- require 'paint'
3
- require 'json'
4
- require 'http'
5
- require 'digest'
6
- require 'io/console'
7
- require 'tempfile'
8
- require 'whirly'
9
- require_relative 'constants'
10
-
11
- module Rise
12
- #
13
- # Utility methods
14
- #
15
- module Util
16
- #
17
- # Checks if rise is being run for the first time
18
- #
19
- def self.first_run?
20
- !File.directory?(File.join(Dir.home, '.rise'))
21
- end
22
-
23
- #
24
- # Check for a new version of the gem
25
- #
26
- def self.check_for_update!
27
- output = ''
28
- temp = Tempfile.new('rise-updater-output')
29
- path = temp.path
30
- system("gem outdated > #{path}")
31
- output << temp.read
32
- if output.include? 'rise-cli'
33
- Whirly.start(
34
- spinner: 'line',
35
- status: Paint['New version available, updating...', 'blue']
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
- rescue StandardError => e
43
- puts "Unable to check for updates. Error: #{Paint[e.message, 'red']}"
44
- exit 1
45
- ensure
46
- temp.close
47
- temp.unlink
48
- end
49
-
50
- #
51
- # Creates all of the necessary files and login information
52
- #
53
- def self.setup
54
- puts Paint['Detected first time setup, creating necessary files...', :blue]
55
- FileUtils.mkdir(RISE_DATA_DIR)
56
- FileUtils.mkdir(File.join(RISE_DATA_DIR, 'auth'))
57
-
58
- # TODO: Reimplement when the backend server actually works
59
- # Get the input from the user
60
- # print Paint['1. Log in\n2. Sign up\n > ', :bold]
61
- # while (choice = gets.chomp!)
62
- # if choice == '1'
63
- # login
64
- # break
65
- # elsif choice == '2'
66
- # signup
67
- # break
68
- # else
69
- # puts Paint['Please type `1` or `2`', :red]
70
- # next
71
- # end
72
- # end
73
- end
74
- end
75
- end
1
+ require 'fileutils'
2
+ require 'paint'
3
+ require 'json'
4
+ require 'http'
5
+ require 'digest'
6
+ require 'io/console'
7
+ require 'tempfile'
8
+ require 'whirly'
9
+ require_relative 'constants'
10
+
11
+ module Rise
12
+ #
13
+ # Utility methods
14
+ #
15
+ module Util
16
+ #
17
+ # Checks if rise is being run for the first time
18
+ #
19
+ def self.first_run?
20
+ !File.directory?(File.join(Dir.home, '.rise'))
21
+ end
22
+
23
+ #
24
+ # Check for a new version of the gem
25
+ #
26
+ def self.check_for_update!
27
+ output = ''
28
+ temp = Tempfile.new('rise-updater-output')
29
+ path = temp.path
30
+ system("gem outdated > #{path}")
31
+ output << temp.read
32
+ if output.include? 'rise-cli'
33
+ Whirly.start(
34
+ spinner: 'line',
35
+ status: Paint['New version available, updating...', 'blue']
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
+ rescue StandardError => e
43
+ puts "Unable to check for updates. Error: #{Paint[e.message, 'red']}"
44
+ exit 1
45
+ ensure
46
+ temp.close
47
+ temp.unlink
48
+ end
49
+
50
+ #
51
+ # Creates all of the necessary files and login information
52
+ #
53
+ def self.setup
54
+ puts Paint['Detected first time setup, creating necessary files...', :blue]
55
+ FileUtils.mkdir(RISE_DATA_DIR)
56
+ FileUtils.mkdir(File.join(RISE_DATA_DIR, 'auth'))
57
+
58
+ # TODO: Reimplement when the backend server actually works
59
+ # Get the input from the user
60
+ # print Paint['1. Log in\n2. Sign up\n > ', :bold]
61
+ # while (choice = gets.chomp!)
62
+ # if choice == '1'
63
+ # login
64
+ # break
65
+ # elsif choice == '2'
66
+ # signup
67
+ # break
68
+ # else
69
+ # puts Paint['Please type `1` or `2`', :red]
70
+ # next
71
+ # end
72
+ # end
73
+ end
74
+ end
75
+ 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.1.7
4
+ version: 0.1.8
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-15 00:00:00.000000000 Z
11
+ date: 2017-10-17 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.6.13
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Simple serverless website deployment