ampercoin-cli 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 29a4c5a029311364443ef37e245f4812878bf98f
4
+ data.tar.gz: 388632b2c2354380b0d68b9481e6fb92f1ca1274
5
+ SHA512:
6
+ metadata.gz: b372e45007ad24514523ddc5cffff1cad9bc2517849e562408636f805c5048f2ae688cb6599b370bc1932c36e783b1017eb1f9522a6e4a723c161cf1ca987cce
7
+ data.tar.gz: de5ebcbd5d9755577c9403b0b00bcf3a0a01492e6fa5e06497554eedf4303a2562d8d4513577669a026a629bbe6a5bf22bece085d8865d61f93f21a5dce63d79
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ampercoin-cli.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 TODO: Write your name
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,58 @@
1
+ # Ampercoin Command Line Utility
2
+
3
+ A tool for trading [Ampercoins](www.ampercoin.com)
4
+
5
+ ## Installation
6
+
7
+ $ gem install ampercoin-cli
8
+
9
+ ## WARNING
10
+
11
+ The Ampercoin network is currently only meant to be used for demonstration
12
+ purposes only. The harvesting system which will keep it secure isn't built yet.
13
+ The network can and will be reset without notice. Hopefully some day this message will go away :).
14
+
15
+ ## Usage
16
+
17
+ Note: Not all of this works yet.
18
+
19
+ Create a new Ampercoin address
20
+
21
+ $ amp new
22
+
23
+ ID | ADDRESS | BALANCE
24
+ ---|-------------------------------|--------
25
+ 1 | &2FMHhuPMXN9DSCKihAHQZytTxAYV | 0
26
+
27
+ Next have someone pay you some ampercoins. @masonforest will probably be on
28
+ \#ampercoin on [freenode](http://webchat.freenode.net/). You can also email
29
+ him at mason@ampercoin.com. A faucet would be nice to have if someone is willing to build it!
30
+
31
+ Transfer from the account you just created to '&mason'
32
+
33
+ $ amp transfer 100 --from 1 --to '&mason'
34
+
35
+ List your accounts
36
+
37
+ $ amp ls
38
+
39
+ ID | ADDRESS | BALANCE
40
+ ---|-------------------------------|--------
41
+ 1 | &2FMHhuPMXN9DSCKihAHQZytTxAYV | 2500
42
+
43
+ Attach a shorter address
44
+
45
+ $ amp shorten '&2FMHhuPMXN9DSCKihAHQZytTxAYV' --to '&somecoolname' --bid 500
46
+
47
+ Submitted bid to shorten address...
48
+
49
+ Your address &2FMHhuPMXN9DSCKihAHQZytTxAYV has been shortened to &somecoolguy
50
+
51
+
52
+ ## Contributing
53
+
54
+ 1. Fork it ( https://github.com/masonforest/ampercoin-cli/fork )
55
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
56
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
57
+ 4. Push to the branch (`git push origin my-new-feature`)
58
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ampercoin/cli/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ampercoin-cli"
8
+ spec.version = Ampercoin::Cli::VERSION
9
+ spec.authors = ["Mason Fischer"]
10
+ spec.email = ["mason@thoughbot.com"]
11
+ spec.summary = %q{A command line interface to the cryptocurrency ampercoin}
12
+ spec.description = %q{A command line interface to the cryptocurrency ampercoin}
13
+ spec.homepage = "http://www.github.com/masonforest/ampercoin-cli"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "activesupport"
22
+ spec.add_development_dependency "bundler", "~> 1.7"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "pry"
25
+ spec.add_development_dependency "rspec"
26
+ spec.add_dependency "activemodel"
27
+ spec.add_dependency "activerecord"
28
+ spec.add_dependency "sqlite3"
29
+ spec.add_dependency "base58"
30
+ spec.add_dependency "table_print"
31
+ end
data/bin/amp ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'ampercoin/cli'
4
+
5
+ Ampercoin::Cli.run
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'bundler' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('bundler', 'bundler')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'coderay' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('coderay', 'coderay')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'htmldiff' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('diff-lcs', 'htmldiff')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'ldiff' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('diff-lcs', 'ldiff')
data/bin/pry ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'pry' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('pry', 'pry')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rake', 'rake')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rspec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rspec-core', 'rspec')
@@ -0,0 +1,44 @@
1
+ require "ampercoin/cli/version"
2
+ require 'ampercoin'
3
+ require 'optparse'
4
+ require 'table_print'
5
+
6
+ module Ampercoin
7
+ module Cli
8
+ def self.run
9
+ options = {}
10
+ action = nil
11
+ OptionParser.new do |opts|
12
+ opts.banner = "Usage: amp [options]"
13
+
14
+ opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
15
+ options[:verbose] = v
16
+ end
17
+
18
+ opts.on('new') do |address|
19
+ action = :generate_address
20
+ end
21
+
22
+ opts.on('ls') do |address|
23
+ action = :list_addresses
24
+ end
25
+
26
+ end.parse!
27
+
28
+ if action
29
+ send(action)
30
+ else
31
+ puts "Usage: amp [options]"
32
+ end
33
+ end
34
+
35
+ def self.list_addresses
36
+ tp Ampercoin::Account.all, :id ,:address, :balance
37
+ end
38
+
39
+ def self.generate_address
40
+ Ampercoin::Account.create
41
+ list_addresses
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,5 @@
1
+ module Ampercoin
2
+ module Cli
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+ require 'active_support/core_ext/kernel/reporting'
3
+
4
+ describe 'amp --generate_address' do
5
+ it 'displays the new address' do
6
+ expect(run_amp(:generate_address)).to include('ADDRESS')
7
+ expect(run_amp(:generate_address)).to match(/&\w+/)
8
+ end
9
+
10
+ it 'persists the address' do
11
+ run_amp(:generate_address)
12
+ expect(run_amp(:list_addresses)).to include('ADDRESS')
13
+ expect(run_amp(:list_addresses)).to match(/&\w+/)
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ require 'ampercoin/cli'
2
+ require 'bundler'
3
+ Dir[File.join(File.dirname(__FILE__),"support/**/*.rb")].each { |f| require f }
4
+
5
+ Bundler.require(:default, :development)
@@ -0,0 +1,8 @@
1
+ require 'active_support/core_ext/kernel/reporting'
2
+
3
+ def run_amp(command, *args)
4
+ capture(:stdout) do
5
+ Ampercoin::Cli.send(command)
6
+ end
7
+ end
8
+
metadata ADDED
@@ -0,0 +1,214 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ampercoin-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mason Fischer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: activemodel
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activerecord
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: sqlite3
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: base58
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: table_print
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ description: A command line interface to the cryptocurrency ampercoin
154
+ email:
155
+ - mason@thoughbot.com
156
+ executables:
157
+ - amp
158
+ - bundler
159
+ - coderay
160
+ - htmldiff
161
+ - ldiff
162
+ - pry
163
+ - rake
164
+ - rspec
165
+ extensions: []
166
+ extra_rdoc_files: []
167
+ files:
168
+ - ".gitignore"
169
+ - Gemfile
170
+ - LICENSE.txt
171
+ - README.md
172
+ - Rakefile
173
+ - ampercoin-cli.gemspec
174
+ - bin/amp
175
+ - bin/bundler
176
+ - bin/coderay
177
+ - bin/htmldiff
178
+ - bin/ldiff
179
+ - bin/pry
180
+ - bin/rake
181
+ - bin/rspec
182
+ - lib/ampercoin/cli.rb
183
+ - lib/ampercoin/cli/version.rb
184
+ - spec/features/generate_address_spec.rb
185
+ - spec/spec_helper.rb
186
+ - spec/support/run_amp.rb
187
+ homepage: http://www.github.com/masonforest/ampercoin-cli
188
+ licenses:
189
+ - MIT
190
+ metadata: {}
191
+ post_install_message:
192
+ rdoc_options: []
193
+ require_paths:
194
+ - lib
195
+ required_ruby_version: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ required_rubygems_version: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - ">="
203
+ - !ruby/object:Gem::Version
204
+ version: '0'
205
+ requirements: []
206
+ rubyforge_project:
207
+ rubygems_version: 2.4.1
208
+ signing_key:
209
+ specification_version: 4
210
+ summary: A command line interface to the cryptocurrency ampercoin
211
+ test_files:
212
+ - spec/features/generate_address_spec.rb
213
+ - spec/spec_helper.rb
214
+ - spec/support/run_amp.rb