blockspring-cli 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -16
- data/lib/blockspring/cli/command/run.rb +44 -2
- data/lib/blockspring/cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b8d67e4863e50ee8e4a30a578a48219d235cf45
|
4
|
+
data.tar.gz: 384d2d94c4f5bd9840e23f33a81ccee172f2d843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8710bcadab9fc2f74c045bbbf8e955e83957990f3d972999810d89a7369c9b1ea489f43eb1983a93a35c4d604c60c194d308b8794b8943c6548e51b31518977
|
7
|
+
data.tar.gz: 563e030d5c09d30f01e8b9878045fb38fcb05f21171db4df071df5d741ddab5b13386de78b6662322dcb22c8d53f541ba3a8d420e428d097820493f536d12f80
|
data/README.md
CHANGED
@@ -1,29 +1,37 @@
|
|
1
|
-
# Blockspring
|
1
|
+
# Blockspring CLI
|
2
2
|
|
3
|
-
|
3
|
+
The Blockspring CLI is used to manage and run blocks from the command line.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
Install via command line:
|
8
8
|
|
9
|
-
gem
|
9
|
+
$ gem install blockspring-cli
|
10
10
|
|
11
|
-
|
11
|
+
## Usage
|
12
12
|
|
13
|
-
|
13
|
+
### Login with your api.blockspring.com account.
|
14
|
+
```bash
|
15
|
+
blockspring login
|
16
|
+
```
|
14
17
|
|
15
|
-
|
18
|
+
### Create a new block
|
19
|
+
```bash
|
20
|
+
blockspring new js "My new JS block"
|
21
|
+
cd my-new-js-block
|
22
|
+
```
|
16
23
|
|
17
|
-
|
24
|
+
### Edit your function
|
25
|
+
```bash
|
26
|
+
echo "console.log('hi');" > block.js
|
27
|
+
```
|
18
28
|
|
19
|
-
|
29
|
+
### Push
|
30
|
+
```bash
|
31
|
+
blockspring push
|
32
|
+
```
|
20
33
|
|
21
|
-
|
34
|
+
## License
|
22
35
|
|
23
|
-
|
36
|
+
MIT - see the license file.
|
24
37
|
|
25
|
-
1. Fork it ( https://github.com/[my-github-username]/blockspring-cli/fork )
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create a new Pull Request
|
@@ -1,8 +1,19 @@
|
|
1
1
|
require "blockspring/cli/command/base"
|
2
2
|
|
3
|
-
# set BLOCKSPRING_API_KEY environment variable and run
|
3
|
+
# set BLOCKSPRING_API_KEY environment variable and run block
|
4
4
|
#
|
5
5
|
class Blockspring::CLI::Command::Run < Blockspring::CLI::Command::Base
|
6
|
+
# run:local COMMAND
|
7
|
+
#
|
8
|
+
# set api key environment variable and run block
|
9
|
+
#
|
10
|
+
# Automatically detects if local or remote
|
11
|
+
# Use run:local or run:remote to specify
|
12
|
+
#
|
13
|
+
#Example:
|
14
|
+
#
|
15
|
+
# $ blockspring run:local node block.js --zip-code=94110
|
16
|
+
#
|
6
17
|
def index
|
7
18
|
if ENV['BLOCKSPRING_API_KEY'].to_s.strip.empty?
|
8
19
|
_, key = Blockspring::CLI::Auth.get_credentials
|
@@ -11,7 +22,38 @@ class Blockspring::CLI::Command::Run < Blockspring::CLI::Command::Base
|
|
11
22
|
end
|
12
23
|
end
|
13
24
|
|
14
|
-
|
25
|
+
match = /([^\/]+\/)([^\/]+)/.match(@args[0])
|
26
|
+
|
27
|
+
if(match and not File.exist?(@args[0]))
|
28
|
+
remote
|
29
|
+
else
|
30
|
+
local
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# run:local COMMAND
|
35
|
+
#
|
36
|
+
# set api key environment variable and run a local block
|
37
|
+
#
|
38
|
+
#Example:
|
39
|
+
#
|
40
|
+
# $ blockspring run:local node block.js --zip-code=94110
|
41
|
+
#
|
42
|
+
def local
|
15
43
|
system(*@args)
|
16
44
|
end
|
45
|
+
|
46
|
+
# run:remote USER/BLOCKID
|
47
|
+
#
|
48
|
+
# set api key environment variable and run a remote block
|
49
|
+
#
|
50
|
+
# [--argname=value ...] # specify arguments for the block
|
51
|
+
#
|
52
|
+
#Example:
|
53
|
+
#
|
54
|
+
# $ blockspring run:remote jtokoph/aasdfj332flk3 --zip-code=94110
|
55
|
+
#
|
56
|
+
def remote
|
57
|
+
error('not yet implimented')
|
58
|
+
end
|
17
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blockspring-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blockspring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|