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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ffcfde424c2580b6d4ef04601e741f1f3f540ba
4
- data.tar.gz: 24f830080543bd5799cd4a8efe7e62d0c62755a4
3
+ metadata.gz: 1b8d67e4863e50ee8e4a30a578a48219d235cf45
4
+ data.tar.gz: 384d2d94c4f5bd9840e23f33a81ccee172f2d843
5
5
  SHA512:
6
- metadata.gz: 9db8dcddfca1a4c15dafd14aae29a65e8888b536ebb2caedb29e13372d0c98e933e42ec747ce66238e51657bcbb0f44f9d32503e1c221b64c1b4578bfaf3de07
7
- data.tar.gz: 63975d283959392ac337c6f2771180909ed53fc74eeb1cc04f4bff3fa0424f76fd739f97bb4d757f1116667da896eb11670236854ab70f6fc40a85dcdbf5c464
6
+ metadata.gz: b8710bcadab9fc2f74c045bbbf8e955e83957990f3d972999810d89a7369c9b1ea489f43eb1983a93a35c4d604c60c194d308b8794b8943c6548e51b31518977
7
+ data.tar.gz: 563e030d5c09d30f01e8b9878045fb38fcb05f21171db4df071df5d741ddab5b13386de78b6662322dcb22c8d53f541ba3a8d420e428d097820493f536d12f80
data/README.md CHANGED
@@ -1,29 +1,37 @@
1
- # Blockspring::Cli
1
+ # Blockspring CLI
2
2
 
3
- TODO: Write a gem description
3
+ The Blockspring CLI is used to manage and run blocks from the command line.
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Install via command line:
8
8
 
9
- gem 'blockspring-cli'
9
+ $ gem install blockspring-cli
10
10
 
11
- And then execute:
11
+ ## Usage
12
12
 
13
- $ bundle
13
+ ### Login with your api.blockspring.com account.
14
+ ```bash
15
+ blockspring login
16
+ ```
14
17
 
15
- Or install it yourself as:
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
- $ gem install blockspring-cli
24
+ ### Edit your function
25
+ ```bash
26
+ echo "console.log('hi');" > block.js
27
+ ```
18
28
 
19
- ## Usage
29
+ ### Push
30
+ ```bash
31
+ blockspring push
32
+ ```
20
33
 
21
- TODO: Write usage instructions here
34
+ ## License
22
35
 
23
- ## Contributing
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 command
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
- # now run
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
@@ -1,5 +1,5 @@
1
1
  module Blockspring
2
2
  module CLI
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  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.6
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-24 00:00:00.000000000 Z
11
+ date: 2014-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler