acm 0.1.0
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 +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/README.md +27 -0
- data/Rakefile +1 -0
- data/acm.gemspec +32 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/exe/acm +56 -0
- data/lib/acm/version.rb +3 -0
- data/lib/acm.rb +5 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e27687eb84c4f28c3c37fd569678d731afd9d28e
|
4
|
+
data.tar.gz: 1931202ebabe42c137a690182addb5816b4b5e25
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4adfb404e3f2cba18666636297cee0d0fff7c897b9d7eada42dea1296742fb42235cbeb9da6d8e5dc1e717d93365e4014e814d2a52858bd0ead9a700e711d8b9
|
7
|
+
data.tar.gz: ccb3aec19e9338dccc45fbadf1efae06f3a19317a11e22d5a3d54d040ad9fc8697385b2f1aa0ee8c96931b06f7994dacd0e44c82a577898e1de60b079efa8c5d
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# acm
|
2
|
+
|
3
|
+
A simple account manager for Windows. This is NOT secure, excuse me ;p.
|
4
|
+
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Install it yourself as:
|
9
|
+
|
10
|
+
$ gem install acm
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
Show help message:
|
15
|
+
|
16
|
+
$ acm help
|
17
|
+
|
18
|
+
## Development
|
19
|
+
|
20
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
21
|
+
|
22
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
|
26
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/takatoh/acm.
|
27
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/acm.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'acm/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "acm"
|
8
|
+
spec.version = Acm::VERSION
|
9
|
+
spec.authors = ["takatoh"]
|
10
|
+
spec.email = ["takatoh.m@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{A simple account manager for Windows (NOT SECURE ;p).}
|
13
|
+
spec.description = %q{}
|
14
|
+
spec.homepage = "https://github.com/takatoh/acm"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
|
+
# delete this section to allow pushing this gem to any host.
|
18
|
+
# if spec.respond_to?(:metadata)
|
19
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
# else
|
21
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
22
|
+
# end
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
30
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
spec.add_runtime_dependency "thor"
|
32
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "acm"
|
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
|
data/bin/setup
ADDED
data/exe/acm
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- encoding: utf-8 -*-
|
3
|
+
|
4
|
+
require 'acm'
|
5
|
+
require 'thor'
|
6
|
+
require 'yaml'
|
7
|
+
|
8
|
+
|
9
|
+
class MyCLI < Thor
|
10
|
+
|
11
|
+
DB_FILE = "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}/Documents/.accounts"
|
12
|
+
|
13
|
+
desc "list", "List accounts"
|
14
|
+
def list
|
15
|
+
db = YAML.load_file(DB_FILE)
|
16
|
+
db.map{|a| a['account'] }.each do |a|
|
17
|
+
puts a
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "show ACCOUNT", "Show details of ACCOUNT"
|
22
|
+
def show(target)
|
23
|
+
db = YAML.load_file(DB_FILE)
|
24
|
+
account = lookup(target, db)
|
25
|
+
if account
|
26
|
+
puts "Account: #{account['account']}"
|
27
|
+
account['details'].each do |key, val|
|
28
|
+
puts " #{key}: #{val}"
|
29
|
+
end
|
30
|
+
else
|
31
|
+
puts "No such account: #{target}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "version", "Show version and exit"
|
36
|
+
def version
|
37
|
+
puts "v#{Acm::VERSION}"
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def lookup(target, db)
|
43
|
+
ac = nil
|
44
|
+
db.each do |a|
|
45
|
+
if a['account'] == target
|
46
|
+
ac = a
|
47
|
+
break
|
48
|
+
end
|
49
|
+
end
|
50
|
+
ac
|
51
|
+
end
|
52
|
+
|
53
|
+
end # of class MyCLI
|
54
|
+
|
55
|
+
|
56
|
+
MyCLI.start(ARGV)
|
data/lib/acm/version.rb
ADDED
data/lib/acm.rb
ADDED
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: acm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- takatoh
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: thor
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: ''
|
56
|
+
email:
|
57
|
+
- takatoh.m@gmail.com
|
58
|
+
executables:
|
59
|
+
- acm
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".travis.yml"
|
65
|
+
- Gemfile
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- acm.gemspec
|
69
|
+
- bin/console
|
70
|
+
- bin/setup
|
71
|
+
- exe/acm
|
72
|
+
- lib/acm.rb
|
73
|
+
- lib/acm/version.rb
|
74
|
+
homepage: https://github.com/takatoh/acm
|
75
|
+
licenses: []
|
76
|
+
metadata: {}
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.4.8
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: A simple account manager for Windows (NOT SECURE ;p).
|
97
|
+
test_files: []
|