pwsqr 0.1.1 → 0.2.0

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: 8e94647f7d956528da1a74dbbca2fcaf398ff0f2
4
+ data.tar.gz: 024bf797d3f323b87593b12d0454e56ab42dbb43
5
+ SHA512:
6
+ metadata.gz: 487a3f9e7ef6729c4ffce95f7b1fd10bd769993eddc2a6edd3dfa15beddc0b371095d4d2a52c013b7e7fba3b2b2afe3947f136ef11515fb24d7411400eab57fc
7
+ data.tar.gz: 3a0a7b374a06b1681ee0453deffe4d33593f18c16fdce23165ad4d3410890d14d5190c50d582a7b10634fa507610d997a9f62a6c849fd47e2a8b374b1ff4e7f1
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2012-2016 Serge Bedzhyk
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.
@@ -0,0 +1,76 @@
1
+ ![PWSQR](./img/pwsqr.png)
2
+
3
+ # pwsqr [![Gem](https://img.shields.io/gem/v/pwsqr.svg)](https://rubygems.org/gems/pwsqr)
4
+
5
+ > Simple QR interface to pws gem. Helps to use your passwords on a smartphone.
6
+
7
+ ## Installation
8
+
9
+ [PWS gem](https://github.com/janlelis/pws) required to use this tool and will be installed as a dependency if you don't have one already.
10
+
11
+ ```
12
+ $ gem install pwsqr
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ This gem helps you securely and easily copy/send passwords from CLI (`pws` tool) to your mobile devices using QR codes.
18
+
19
+ When `pwsqr` works online it tries to use [onetimesecret.com](https://onetimesecret.com) service to store your password privately behind the QR code with a short URL.
20
+
21
+ To use this feature, run pwsqr with `pwsqr --init` command first and setup your email address and API key in the newly generated config file in your `$HOME` directory: `~/.pwsqr`
22
+
23
+ If you want to generate config file from scratch delete the old one before running `pwsqr --init`
24
+
25
+ ```
26
+ $ pwsqr --help
27
+
28
+
29
+ ======================================================
30
+ Command-line QR tool for PWS gem 📲
31
+ ======================================================
32
+
33
+ Usage:
34
+ pwsqr [--offline | --email] [--namespace <namespace>] <key>
35
+ pwsqr --version
36
+ pwsqr --help
37
+ pwsqr --init
38
+
39
+ Options:
40
+ --version, -v Show the current app version
41
+ --help, -h Show this message
42
+ --init Initialise new configuration (won't break the old one)
43
+ --namespace <namespace>, -n <namespace> Use custom pws namespace
44
+ --offline, -o Force local password usage (force offline usage,
45
+ mind the length of the password and terminal history)
46
+ --email, -e Send a friendly email containing the secret link
47
+ ```
48
+
49
+ ```sh
50
+ # Home
51
+ $ pwsqr twitter # get twitter password (online/QR)
52
+ $ pwsqr -e twitter # get twitter password (online/email)
53
+ $ pwsqr -o twitter # get twitter password (offline/QR)
54
+
55
+ # Work
56
+ $ pwsqr -n work -o github # get github password (offline/work namespace/QR)
57
+ $ pwsqr -n work github # get github password (online/work namespace/QR)
58
+ $ pwsqr -n work -e github # get github password (online/work namespace/email)
59
+ ```
60
+
61
+ Then you check your email (if you used `--email` / `-e` flag) or scan QR-code with any QR scanner (I use really fast one: [Optiscan QR Code Reader](https://itunes.apple.com/us/app/optiscan-qr-code-scanner-generator/id304099767) ⚠️ **this is not an advert**)
62
+
63
+ ## To-Do
64
+
65
+ * [ ] Testing
66
+ * [ ] Configure CI
67
+ * [ ] Code documenting
68
+
69
+ ## Contributing
70
+
71
+ See [contributing.md](./contributing.md)
72
+
73
+ ## License / Copyrights
74
+
75
+ * [MIT](./LICENSE) © 2012 - 2016 [Serge Bedzhyk](https://github.com/smileart)
76
+ * Image font source: [3Dventure](http://www.dafont.com/3dventure.font)
data/Rakefile CHANGED
@@ -1,54 +1,7 @@
1
- # encoding: utf-8
2
-
3
- require 'rubygems'
4
- require 'bundler'
5
- begin
6
- Bundler.setup(:default, :development)
7
- rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
10
- exit e.status_code
11
- end
12
1
  require 'rake'
13
2
 
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "pwsqr"
18
- gem.homepage = "http://github.com/smileart/pwsqr"
19
- gem.license = "MIT"
20
- gem.summary = %Q{Simple QR interface to pws gem, to easily use your passwords on a smartphone!}
21
- gem.description = %Q{This gem helps you securely and easily copy passwords from terminal pws tool, to your mobile devices using QR codes.}
22
- gem.email = "smileart21@gmail.com"
23
- gem.authors = ["Smile @rT"]
24
- gem.executables = ["pwsqr"]
25
- # dependencies defined in Gemfile
26
- end
27
- Jeweler::RubygemsDotOrgTasks.new
28
-
29
- require 'rake/testtask'
30
- Rake::TestTask.new(:test) do |test|
31
- test.libs << 'lib' << 'test'
32
- test.pattern = 'test/**/test_*.rb'
33
- test.verbose = true
34
- end
35
-
36
- require 'rcov/rcovtask'
37
- Rcov::RcovTask.new do |test|
38
- test.libs << 'test'
39
- test.pattern = 'test/**/test_*.rb'
40
- test.verbose = true
41
- test.rcov_opts << '--exclude "gems/*"'
42
- end
43
-
44
3
  task :default => :test
45
4
 
46
- require 'rdoc/task'
47
- Rake::RDocTask.new do |rdoc|
48
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
-
50
- rdoc.rdoc_dir = 'rdoc'
51
- rdoc.title = "pwsqr #{version}"
52
- rdoc.rdoc_files.include('README*')
53
- rdoc.rdoc_files.include('lib/**/*.rb')
5
+ task :test do
6
+ # testing goes here
54
7
  end
data/bin/pwsqr CHANGED
@@ -1,81 +1,244 @@
1
1
  #! /usr/bin/env ruby
2
- #! coding = utf-8
3
2
 
4
- require 'clamp'
3
+ require 'docopt'
5
4
  require 'clipboard'
6
5
  require 'yaml'
6
+ require 'logger'
7
+ require 'open3'
8
+ require 'colorize'
9
+ require 'open-uri'
10
+ require 'rqrcode'
11
+ require 'onetime/api'
12
+
13
+ require_relative '../lib/pwsqr.rb'
14
+
15
+ # Public: main CLI interface class
16
+ # Process args, executes external binaries (e.g. pws)
17
+ class PwsQR
18
+ attr_reader :clipboard_backup
19
+
20
+ CONFIG_PATH = "#{Dir.home}/.#{PwsQrEnv::NAME}".freeze
21
+ ONETIME_SIGNUP_URL = 'https://onetimesecret.com/signup'.blue.freeze
22
+ ONETIME_SECRET_BASE_URL = 'https://onetimesecret.com/secret/'.freeze
23
+
24
+ # \x0 hack fixes Docopt first line indentation issue!!!
25
+ DOCOPT = <<-"DOC".freeze
26
+ \x0
27
+ ======================================================
28
+ Command-line QR tool for PWS gem 📲
29
+ ======================================================
30
+
31
+ Usage:
32
+ #{PwsQrEnv::NAME} [--offline | --email] [--namespace <namespace>] <key>
33
+ #{PwsQrEnv::NAME} --version
34
+ #{PwsQrEnv::NAME} --help
35
+ #{PwsQrEnv::NAME} --init
36
+
37
+ Options:
38
+ --version, -v Show the current app version
39
+ --help, -h Show this message
40
+ --init Initialise new configuration (won't break the old one)
41
+ --namespace <namespace>, -n <namespace> Use custom pws namespace
42
+ --offline, -o Force local password usage (force offline usage,
43
+ mind the length of the password and terminal history)
44
+ --email, -e Send a friendly email containing the secret link
45
+ DOC
46
+
47
+ INITDOC = <<-"INITDOC".freeze
48
+ Initialising configuration… #{CONFIG_PATH.yellow}
49
+
50
+ In order to use pwsqr online, please create your account here: #{ONETIME_SIGNUP_URL}
51
+ and setup your settings in #{CONFIG_PATH.yellow} config file. Thanks! >^.^<
52
+
53
+ If you actually wanted to use it offline — run the command with `--offline` flag!
54
+ INITDOC
55
+
56
+ API_KEY_PLACEHOLDER = '< PLEASE VISIT https://onetimesecret.com/account TO GET YOUR KEY! >'
57
+
58
+ CONFIG_DEFAULTS = {
59
+ onetime: {
60
+ email: nil,
61
+ api_key: API_KEY_PLACEHOLDER
62
+ },
63
+ url_shortening: {
64
+ url: 'https://clck.ru/--?url='
65
+ }
66
+ }.freeze
67
+
68
+ ERROR_MESSAGES = {
69
+ onetime_wrong_response: 'One-Time Secret didn\'t respond properly! Check your config, please.',
70
+ url_shortener_wrong_response: 'URL shortener didn\'t respond properly! Check your config, please.',
71
+ network_error: "Network error occurred\nProbably there is no internet connection or external service is down!",
72
+ config_error: "PWSQR can't work online unless you properly configure it.\nTry to run it with `--init` flag or use `--offline`"
73
+ }.freeze
74
+
75
+ def initialize(logger_class, logger_device, logger_level)
76
+ @logger = logger_class.new(logger_device)
77
+ @logger.level = logger_level
78
+ end
7
79
 
8
- class PwsQrCommand < Clamp::Command
80
+ def run
81
+ @clipboard_backup = Clipboard.paste
9
82
 
10
- parameter "key", "the key password sotred on"
11
- option ["--offline", "--local", "-o"], :flag, "force local password usage (disable onetimesecret if configured)\n" +
12
- "WARNING: be careful using this option and remember to reset your terminal output history"
13
- option ["-e", "--email"], :flag, "generates onetimesecret URL and also send it to your account"
14
- option ["-n", "--namespace"], "NAMESPACE", "selects pws namespace to get password from it"
83
+ @docopt = Docopt.docopt(DOCOPT)
84
+ @docopt['--namespace'] = @docopt['--namespace'] ? "-'#{@docopt['--namespace']}'" : ''
85
+ @pws_command = "pws #{@docopt['--namespace']} get #{@docopt['<key>']} 0"
15
86
 
16
- PATH = ENV['HOME']+"/.pwsqr"
87
+ load_config
17
88
 
18
- if(File.exists?(PATH))
19
- CONFIG = YAML.load_file(PATH) unless defined? CONFIG
20
- else
21
- config = {onetime:{email:'', api_key:''}, url_shortening:{url:'http://clck.ru/--?url='}}
89
+ version if @docopt['--version']
90
+ init_config if @docopt['--init']
91
+ pwsqr if @docopt['<key>']
92
+ end
22
93
 
23
- File.open(PATH, "w") do |f|
24
- f.write(config.to_yaml)
25
- end
94
+ def error(message)
95
+ puts "ERROR: #{message}".red
96
+ end
97
+
98
+ private
26
99
 
27
- if ARGV[0] == 'init'
28
- puts " pwsqr config generated in your home folder: #{PATH}\n"
29
- puts " In order to use pwsqr online, please create your account here https://onetimesecret.com/signup\n"
30
- puts " end setup your settings in that config file. Thanks! ◕ ◡ ◕ \n"
31
- exit
100
+ def pws
101
+ exit unless system(@pws_command)
102
+ end
103
+
104
+ def pwsqr
105
+ if @docopt['--offline']
106
+ pws_offline
107
+ else
108
+ if config?
109
+ pws_online
110
+ else
111
+ raise ConfigError
112
+ end
32
113
  end
33
114
  end
34
115
 
35
- self.description = %{
36
- ======================================================
37
- Command line QR tool for PWS gem…
38
- ======================================================
39
- }
116
+ def init_config
117
+ @config ||= CONFIG_DEFAULTS
118
+ File.open(CONFIG_PATH, 'w').write(@config.to_yaml)
40
119
 
41
- def execute
120
+ print INITDOC
121
+ exit
122
+ end
123
+
124
+ def version
125
+ puts "#{PwsQrEnv::NAME.upcase} v.#{PwsQrEnv::VERSION}"
126
+ exit
127
+ end
42
128
 
43
- if(!namespace.nil?)
44
- ns = " -#{namespace} "
129
+ def load_config
130
+ if File.exist?(CONFIG_PATH)
131
+ @config ||= YAML.load_file(CONFIG_PATH)
45
132
  else
46
- ns = " "
133
+ init_config
47
134
  end
135
+ end
48
136
 
49
- backup = Clipboard.paste
137
+ def config?
138
+ return false unless @config && @config[:onetime] && @config[:url_shortening]
50
139
 
51
- if(system("pws#{ns}get #{key} 0"))
52
- if(defined?(CONFIG) && !CONFIG[:onetime][:email].empty? && !offline?)
53
- require 'open-uri'
54
- require 'onetime/api'
140
+ onetime_conf = @config[:onetime]
141
+ url_short_conf = @config[:url_shortening]
55
142
 
56
- api = Onetime::API.new CONFIG[:onetime][:email], CONFIG[:onetime][:api_key]
143
+ @config &&
144
+ onetime_conf[:email] &&
145
+ onetime_conf[:api_key] &&
146
+ onetime_conf[:api_key] != API_KEY_PLACEHOLDER &&
147
+ url_short_conf &&
148
+ url_short_conf[:url] &&
149
+ !url_short_conf[:url].empty?
150
+ end
57
151
 
58
- options = {
59
- :secret => Clipboard.paste,
60
- :ttl => 7200
61
- }
152
+ def qrcode_factory(str, config={})
153
+ begin
154
+ return RQRCode::QRCode.new(str, config)
155
+ rescue RQRCode::QRCodeRunTimeError => e
156
+ config[:size] += 1
157
+ raise e if config[:size] > 20
158
+ retry
159
+ end
160
+ end
62
161
 
63
- options[:recipient] = CONFIG[:onetime][:email] if email?
162
+ def generate_qr(str)
163
+ qrcode = qrcode_factory(str, size: 1, level: :l)
64
164
 
65
- secret = api.post '/share', options
66
- url = 'https://onetimesecret.com/secret/' + secret['secret_key']
165
+ print qrcode.as_ansi(light: "\e[107m", dark: "\e[40m",
166
+ fill_character: ' ',
167
+ quiet_zone_size: 1)
168
+ exit
169
+ end
67
170
 
68
- short_url = open(CONFIG[:url_shortening][:url]+url).read
69
- system("qrcli #{short_url}")
70
- else
71
- require 'open3'
72
- Open3.popen3("qrcli", Clipboard.paste) { |i, o| puts o.read }
73
- end
171
+ def shorten_url(url)
172
+ url = open(@config[:url_shortening][:url] + url).read
173
+ url = !url.strip.empty? && url.length <= 25 ? url : nil
74
174
 
75
- Clipboard.copy(backup)
76
- end
175
+ url
176
+ end
177
+
178
+ def onetime
179
+ onetime_conf = @config[:onetime]
180
+
181
+ onetime_api = Onetime::API.new onetime_conf[:email], onetime_conf[:api_key]
182
+
183
+ options = { secret: Clipboard.paste, ttl: 7200 }
184
+ options[:recipient] = onetime_conf[:email] if onetime_conf[:email] && @docopt['--email']
185
+
186
+ onetime_api.post '/share', options
187
+ end
188
+
189
+ def onetime_url(secret_key)
190
+ url = ONETIME_SECRET_BASE_URL + secret_key
191
+ exit if @docopt['--email']
192
+ url
193
+ end
194
+
195
+ def pws_offline
196
+ puts 'PWSQR works offline!'.yellow
197
+ exit unless system(@pws_command)
77
198
 
199
+ generate_qr(Clipboard.paste)
200
+ end
201
+
202
+ def pws_online
203
+ puts 'PWSQR works online!'.green
204
+ pws
205
+
206
+ secret = onetime
207
+ raise OneTimeError unless secret['secret_key']
208
+
209
+ short_url = shorten_url onetime_url secret['secret_key']
210
+ raise UrlShorteningError unless short_url
211
+
212
+ generate_qr(short_url)
78
213
  end
79
214
  end
80
215
 
81
- PwsQrCommand.run
216
+ class ConfigError < StandardError; end
217
+ class OneTimeError < StandardError; end
218
+ class UrlShorteningError < StandardError; end
219
+
220
+ trap(:INT) do
221
+ exit
222
+ end
223
+
224
+ LOGGER_LEVEL = PwsQrEnv::DEBUG ? PwsQrEnv::DEBUG : Logger::UNKNOWN
225
+
226
+ begin
227
+ app = PwsQR.new(Logger, STDOUT, LOGGER_LEVEL)
228
+ app.run
229
+ rescue Net::ReadTimeout, OpenURI::HTTPError, SocketError
230
+ app.error PwsQR::ERROR_MESSAGES[:network_error]
231
+ rescue JSON::ParserError
232
+ app.error PwsQR::ERROR_MESSAGES[:onetime_wrong_response]
233
+ rescue ConfigError
234
+ app.error PwsQR::ERROR_MESSAGES[:config_error]
235
+ rescue UrlShorteningError
236
+ app.error PwsQR::ERROR_MESSAGES[:url_shortener_wrong_response]
237
+ rescue OneTimeError => e
238
+ app.error PwsQR::ERROR_MESSAGES[:onetime_wrong_response]
239
+ rescue Docopt::Exit => e
240
+ puts e.message
241
+ puts
242
+ ensure
243
+ Clipboard.copy(app.clipboard_backup)
244
+ end
@@ -0,0 +1,57 @@
1
+ # Contributing to pwsqr
2
+
3
+ First and foremost, thank you! We appreciate that you want to contribute to pwsqr, your time is valuable, and your contributions mean a lot to us.
4
+
5
+ **What does "contributing" mean?**
6
+
7
+ Creating an issue is the simplest form of contributing to a project. But there are many ways to contribute, including the following:
8
+
9
+ - Updating or correcting documentation
10
+ - Feature requests
11
+ - Bug reports
12
+
13
+ If you'd like to learn more about contributing in general, the [Guide to Idiomatic Contributing](https://github.com/jonschlinkert/idiomatic-contributing) has a lot of useful information.
14
+
15
+ **Showing support for pwsqr**
16
+
17
+ Please keep in mind that open source software is built by people like you, who spend their free time creating things the rest the community can use.
18
+
19
+ Don't have time to contribute? No worries, here are some other ways to show your support for pwsqr:
20
+
21
+ - star the [project](https://github.com/smileart/pwsqr)
22
+ - tweet your support for pwsqr
23
+
24
+ ## Issues
25
+
26
+ ### Before creating an issue
27
+
28
+ Please try to determine if the issue is caused by an underlying library, and if so, create the issue there. Sometimes this is difficult to know. We only ask that you attempt to give a reasonable attempt to find out. Oftentimes the readme will have advice about where to go to create issues.
29
+
30
+ Try to follow these guidelines
31
+
32
+ - **Investigate the issue**:
33
+ - **Check the readme** - oftentimes you will find notes about creating issues, and where to go depending on the type of issue.
34
+ - Create the issue in the appropriate repository.
35
+
36
+ ### Creating an issue
37
+
38
+ Please be as descriptive as possible when creating an issue. Give us the information we need to successfully answer your question or address your issue by answering the following in your issue:
39
+
40
+ - **version**: please note the version of pwsqr are you using
41
+ - **extensions, plugins, helpers, etc** (if applicable): please list any extensions you're using
42
+ - **error messages**: please paste any error messages into the issue, or a [gist](https://gist.github.com/)
43
+
44
+ ## Above and beyond
45
+
46
+ Here are some tips for creating idiomatic issues. Taking just a little bit extra time will make your issue easier to read, easier to resolve, more likely to be found by others who have the same or similar issue in the future.
47
+
48
+ - read the [Guide to Idiomatic Contributing](https://github.com/jonschlinkert/idiomatic-contributing)
49
+ - take some time to learn basic markdown. This [markdown cheatsheet](https://gist.github.com/jonschlinkert/5854601) is super helpful, as is the GitHub guide to [basic markdown](https://help.github.com/articles/markdown-basics/).
50
+ - Learn about [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown/). And if you want to really go above and beyond, read [mastering markdown](https://guides.github.com/features/mastering-markdown/).
51
+ - use backticks to wrap code. This ensures that code will retain its format, making it much more readable to others
52
+ - use syntax highlighting by adding the correct language name after the first "code fence"
53
+
54
+
55
+ [node-glob]: https://github.com/isaacs/node-glob
56
+ [micromatch]: https://github.com/jonschlinkert/micromatch
57
+ [so]: http://stackoverflow.com/questions/tagged/pwsqr
@@ -0,0 +1,11 @@
1
+ require 'pathname'
2
+
3
+ module PwsQrEnv
4
+ PROJECT_ROOT = File.expand_path(Pathname.new(__FILE__).join('../..'))
5
+ DEBUG = ENV['PWSQR_DEBUG'] && !ENV['PWSQR_DEBUG'].empty? ? ENV['PWSQR_DEBUG'].to_i : false
6
+ VERSION = '0.2.0'
7
+ NAME = 'pwsqr'
8
+ end
9
+
10
+ require 'letters' if PwsQrEnv::DEBUG && PwsQrEnv::DEBUG == 0
11
+ require 'byebug' if PwsQrEnv::DEBUG && PwsQrEnv::DEBUG == 0
@@ -1,85 +1,38 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
1
+ # -*- encoding: utf-8 -*
2
+ require File.dirname(__FILE__) + "/lib/pwsqr"
5
3
 
6
4
  Gem::Specification.new do |s|
7
- s.name = "pwsqr"
8
- s.version = "0.1.1"
5
+ s.platform = Gem::Platform::RUBY
6
+ s.name = PwsQrEnv::NAME
7
+ s.version = PwsQrEnv::VERSION
8
+ s.date = Date.today.to_s
9
+ s.authors = ["Serge Bedzhyk"]
10
+ s.email = "smileart21@gmail.com"
11
+ s.homepage = 'https://github.com/smileart/pwsqr'
9
12
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Smile @rT"]
12
- s.date = "2012-11-19"
13
- s.description = "This gem helps you securely and easily copy passwords from terminal pws tool, to your mobile devices using QR codes."
14
- s.email = "smileart21@gmail.com"
15
- s.executables = ["pwsqr"]
16
- s.extra_rdoc_files = [
17
- "LICENSE.txt",
18
- "README.rdoc"
19
- ]
20
- s.files = [
21
- ".document",
22
- "Gemfile",
23
- "Gemfile.lock",
24
- "LICENSE.txt",
25
- "README.rdoc",
26
- "Rakefile",
27
- "VERSION",
28
- "bin/pwsqr",
29
- "lib/pwsqr.rb",
30
- "pwsqr.gemspec",
31
- "test/helper.rb",
32
- "test/test_pwsqr.rb"
33
- ]
34
- s.homepage = "http://github.com/smileart/pwsqr"
35
- s.licenses = ["MIT"]
36
- s.require_paths = ["lib"]
37
- s.rubygems_version = "1.8.24"
38
- s.summary = "Simple QR interface to pws gem, to easily use your passwords on a smartphone!"
13
+ s.summary = "Simple QR interface to pws gem."
14
+ s.description = "Simple QR interface to pws gem. Helps to use your passwords on a smartphone."
39
15
 
40
- if s.respond_to? :specification_version then
41
- s.specification_version = 3
16
+ s.files = Dir.glob(%w[{lib,test,img}/**/*.rb bin/*]) + %w{Rakefile pwsqr.gemspec}
17
+ s.extra_rdoc_files = ["README.md", "LICENSE", "contributing.md"]
18
+ s.executables = [PwsQrEnv::NAME]
42
19
 
43
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
44
- s.add_runtime_dependency(%q<clipboard>, [">= 0"])
45
- s.add_runtime_dependency(%q<clamp>, [">= 0"])
46
- s.add_runtime_dependency(%q<onetime>, [">= 0"])
47
- s.add_runtime_dependency(%q<qrcli>, [">= 0"])
48
- s.add_runtime_dependency(%q<pws>, [">= 0"])
49
- s.add_development_dependency(%q<shoulda>, [">= 0"])
50
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
51
- s.add_development_dependency(%q<bundler>, ["> 1.0.0"])
52
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
53
- s.add_development_dependency(%q<simplecov>, [">= 0"])
54
- s.add_development_dependency(%q<rcov>, [">= 0"])
55
- s.add_development_dependency(%q<awesome_print>, [">= 0"])
56
- else
57
- s.add_dependency(%q<clipboard>, [">= 0"])
58
- s.add_dependency(%q<clamp>, [">= 0"])
59
- s.add_dependency(%q<onetime>, [">= 0"])
60
- s.add_dependency(%q<qrcli>, [">= 0"])
61
- s.add_dependency(%q<pws>, [">= 0"])
62
- s.add_dependency(%q<shoulda>, [">= 0"])
63
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
64
- s.add_dependency(%q<bundler>, ["> 1.0.0"])
65
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
66
- s.add_dependency(%q<simplecov>, [">= 0"])
67
- s.add_dependency(%q<rcov>, [">= 0"])
68
- s.add_dependency(%q<awesome_print>, [">= 0"])
69
- end
70
- else
71
- s.add_dependency(%q<clipboard>, [">= 0"])
72
- s.add_dependency(%q<clamp>, [">= 0"])
73
- s.add_dependency(%q<onetime>, [">= 0"])
74
- s.add_dependency(%q<qrcli>, [">= 0"])
75
- s.add_dependency(%q<pws>, [">= 0"])
76
- s.add_dependency(%q<shoulda>, [">= 0"])
77
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
78
- s.add_dependency(%q<bundler>, ["> 1.0.0"])
79
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
80
- s.add_dependency(%q<simplecov>, [">= 0"])
81
- s.add_dependency(%q<rcov>, [">= 0"])
82
- s.add_dependency(%q<awesome_print>, [">= 0"])
83
- end
84
- end
20
+ s.required_ruby_version = '>= 1.9.3'
21
+ s.license = 'MIT'
22
+
23
+ s.add_dependency 'pws', '~> 1.0'
24
+ s.add_dependency 'clipboard', '~> 1.0'
25
+ s.add_dependency 'rqrcode', '~> 0.10'
26
+ s.add_dependency 'onetime', '~> 0.5'
27
+ s.add_dependency 'docopt', '~> 0.5.0'
28
+ s.add_dependency 'colorize', '~> 0.8'
85
29
 
30
+ s.add_development_dependency 'rake', '~> 12.0'
31
+ s.add_development_dependency 'bundler', '~> 1.13'
32
+ s.add_development_dependency 'simplecov', '~> 0.10'
33
+ s.add_development_dependency 'letters', '~> 0.4'
34
+ s.add_development_dependency 'byebug', '~> 9.0'
35
+ s.add_development_dependency 'gitignore', '~> 0.1'
36
+ s.add_development_dependency 'rubocop', '~> 0.46'
37
+ s.add_development_dependency 'reek', '~> 4.5'
38
+ end
@@ -1,18 +1,10 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
1
+ require "minitest/reporters"
2
+ require 'simplecov'
12
3
 
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'pwsqr'
4
+ SimpleCov.start
16
5
 
17
- class Test::Unit::TestCase
18
- end
6
+ Minitest::RelativePosition::TEST_SIZE = 75
7
+
8
+ Minitest::Reporters.use! [
9
+ Minitest::Reporters::SpecReporter.new
10
+ ]
@@ -0,0 +1,7 @@
1
+ require 'minitest/autorun'
2
+ require_relative 'helper'
3
+
4
+ describe '' do
5
+ it '' do
6
+ end
7
+ end
metadata CHANGED
@@ -1,256 +1,252 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwsqr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
- - Smile @rT
7
+ - Serge Bedzhyk
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-19 00:00:00.000000000 Z
11
+ date: 2017-01-06 00:00:00.000000000 Z
13
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pws
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
14
27
  - !ruby/object:Gem::Dependency
15
28
  name: clipboard
16
29
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
30
  requirements:
19
- - - ! '>='
31
+ - - "~>"
20
32
  - !ruby/object:Gem::Version
21
- version: '0'
33
+ version: '1.0'
22
34
  type: :runtime
23
35
  prerelease: false
24
36
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
37
  requirements:
27
- - - ! '>='
38
+ - - "~>"
28
39
  - !ruby/object:Gem::Version
29
- version: '0'
40
+ version: '1.0'
30
41
  - !ruby/object:Gem::Dependency
31
- name: clamp
42
+ name: rqrcode
32
43
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
44
  requirements:
35
- - - ! '>='
45
+ - - "~>"
36
46
  - !ruby/object:Gem::Version
37
- version: '0'
47
+ version: '0.10'
38
48
  type: :runtime
39
49
  prerelease: false
40
50
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
51
  requirements:
43
- - - ! '>='
52
+ - - "~>"
44
53
  - !ruby/object:Gem::Version
45
- version: '0'
54
+ version: '0.10'
46
55
  - !ruby/object:Gem::Dependency
47
56
  name: onetime
48
57
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
58
  requirements:
51
- - - ! '>='
59
+ - - "~>"
52
60
  - !ruby/object:Gem::Version
53
- version: '0'
61
+ version: '0.5'
54
62
  type: :runtime
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
65
  requirements:
59
- - - ! '>='
66
+ - - "~>"
60
67
  - !ruby/object:Gem::Version
61
- version: '0'
68
+ version: '0.5'
62
69
  - !ruby/object:Gem::Dependency
63
- name: qrcli
70
+ name: docopt
64
71
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
72
  requirements:
67
- - - ! '>='
73
+ - - "~>"
68
74
  - !ruby/object:Gem::Version
69
- version: '0'
75
+ version: 0.5.0
70
76
  type: :runtime
71
77
  prerelease: false
72
78
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
79
  requirements:
75
- - - ! '>='
80
+ - - "~>"
76
81
  - !ruby/object:Gem::Version
77
- version: '0'
82
+ version: 0.5.0
78
83
  - !ruby/object:Gem::Dependency
79
- name: pws
84
+ name: colorize
80
85
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
86
  requirements:
83
- - - ! '>='
87
+ - - "~>"
84
88
  - !ruby/object:Gem::Version
85
- version: '0'
89
+ version: '0.8'
86
90
  type: :runtime
87
91
  prerelease: false
88
92
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
93
  requirements:
91
- - - ! '>='
94
+ - - "~>"
92
95
  - !ruby/object:Gem::Version
93
- version: '0'
96
+ version: '0.8'
94
97
  - !ruby/object:Gem::Dependency
95
- name: shoulda
98
+ name: rake
96
99
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
100
  requirements:
99
- - - ! '>='
101
+ - - "~>"
100
102
  - !ruby/object:Gem::Version
101
- version: '0'
103
+ version: '12.0'
102
104
  type: :development
103
105
  prerelease: false
104
106
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
107
  requirements:
107
- - - ! '>='
108
+ - - "~>"
108
109
  - !ruby/object:Gem::Version
109
- version: '0'
110
+ version: '12.0'
110
111
  - !ruby/object:Gem::Dependency
111
- name: rdoc
112
+ name: bundler
112
113
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '3.12'
117
+ version: '1.13'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
121
  requirements:
123
- - - ~>
122
+ - - "~>"
124
123
  - !ruby/object:Gem::Version
125
- version: '3.12'
124
+ version: '1.13'
126
125
  - !ruby/object:Gem::Dependency
127
- name: bundler
126
+ name: simplecov
128
127
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
128
  requirements:
131
- - - ! '>'
129
+ - - "~>"
132
130
  - !ruby/object:Gem::Version
133
- version: 1.0.0
131
+ version: '0.10'
134
132
  type: :development
135
133
  prerelease: false
136
134
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
135
  requirements:
139
- - - ! '>'
136
+ - - "~>"
140
137
  - !ruby/object:Gem::Version
141
- version: 1.0.0
138
+ version: '0.10'
142
139
  - !ruby/object:Gem::Dependency
143
- name: jeweler
140
+ name: letters
144
141
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
142
  requirements:
147
- - - ~>
143
+ - - "~>"
148
144
  - !ruby/object:Gem::Version
149
- version: 1.8.4
145
+ version: '0.4'
150
146
  type: :development
151
147
  prerelease: false
152
148
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
149
  requirements:
155
- - - ~>
150
+ - - "~>"
156
151
  - !ruby/object:Gem::Version
157
- version: 1.8.4
152
+ version: '0.4'
158
153
  - !ruby/object:Gem::Dependency
159
- name: simplecov
154
+ name: byebug
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '9.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '9.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: gitignore
160
169
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
170
  requirements:
163
- - - ! '>='
171
+ - - "~>"
164
172
  - !ruby/object:Gem::Version
165
- version: '0'
173
+ version: '0.1'
166
174
  type: :development
167
175
  prerelease: false
168
176
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
177
  requirements:
171
- - - ! '>='
178
+ - - "~>"
172
179
  - !ruby/object:Gem::Version
173
- version: '0'
180
+ version: '0.1'
174
181
  - !ruby/object:Gem::Dependency
175
- name: rcov
182
+ name: rubocop
176
183
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
184
  requirements:
179
- - - ! '>='
185
+ - - "~>"
180
186
  - !ruby/object:Gem::Version
181
- version: '0'
187
+ version: '0.46'
182
188
  type: :development
183
189
  prerelease: false
184
190
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
191
  requirements:
187
- - - ! '>='
192
+ - - "~>"
188
193
  - !ruby/object:Gem::Version
189
- version: '0'
194
+ version: '0.46'
190
195
  - !ruby/object:Gem::Dependency
191
- name: awesome_print
196
+ name: reek
192
197
  requirement: !ruby/object:Gem::Requirement
193
- none: false
194
198
  requirements:
195
- - - ! '>='
199
+ - - "~>"
196
200
  - !ruby/object:Gem::Version
197
- version: '0'
201
+ version: '4.5'
198
202
  type: :development
199
203
  prerelease: false
200
204
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
205
  requirements:
203
- - - ! '>='
206
+ - - "~>"
204
207
  - !ruby/object:Gem::Version
205
- version: '0'
206
- description: This gem helps you securely and easily copy passwords from terminal pws
207
- tool, to your mobile devices using QR codes.
208
+ version: '4.5'
209
+ description: Simple QR interface to pws gem. Helps to use your passwords on a smartphone.
208
210
  email: smileart21@gmail.com
209
211
  executables:
210
212
  - pwsqr
211
213
  extensions: []
212
214
  extra_rdoc_files:
213
- - LICENSE.txt
214
- - README.rdoc
215
+ - README.md
216
+ - LICENSE
217
+ - contributing.md
215
218
  files:
216
- - .document
217
- - Gemfile
218
- - Gemfile.lock
219
- - LICENSE.txt
220
- - README.rdoc
219
+ - LICENSE
220
+ - README.md
221
221
  - Rakefile
222
- - VERSION
223
222
  - bin/pwsqr
223
+ - contributing.md
224
224
  - lib/pwsqr.rb
225
225
  - pwsqr.gemspec
226
226
  - test/helper.rb
227
- - test/test_pwsqr.rb
228
- homepage: http://github.com/smileart/pwsqr
227
+ - test/sample_spec.rb
228
+ homepage: https://github.com/smileart/pwsqr
229
229
  licenses:
230
230
  - MIT
231
+ metadata: {}
231
232
  post_install_message:
232
233
  rdoc_options: []
233
234
  require_paths:
234
235
  - lib
235
236
  required_ruby_version: !ruby/object:Gem::Requirement
236
- none: false
237
237
  requirements:
238
- - - ! '>='
238
+ - - ">="
239
239
  - !ruby/object:Gem::Version
240
- version: '0'
241
- segments:
242
- - 0
243
- hash: -3466176510519665660
240
+ version: 1.9.3
244
241
  required_rubygems_version: !ruby/object:Gem::Requirement
245
- none: false
246
242
  requirements:
247
- - - ! '>='
243
+ - - ">="
248
244
  - !ruby/object:Gem::Version
249
245
  version: '0'
250
246
  requirements: []
251
247
  rubyforge_project:
252
- rubygems_version: 1.8.24
248
+ rubygems_version: 2.5.2
253
249
  signing_key:
254
- specification_version: 3
255
- summary: Simple QR interface to pws gem, to easily use your passwords on a smartphone!
250
+ specification_version: 4
251
+ summary: Simple QR interface to pws gem.
256
252
  test_files: []
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/Gemfile DELETED
@@ -1,17 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gem "clipboard"
4
- gem "clamp"
5
- gem "onetime"
6
- gem "qrcli"
7
- gem "pws"
8
-
9
- group :development do
10
- gem "shoulda", ">= 0"
11
- gem "rdoc", "~> 3.12"
12
- gem "bundler", "> 1.0.0"
13
- gem "jeweler", "~> 1.8.4"
14
- gem "simplecov", ">= 0"
15
- gem "rcov"
16
- gem "awesome_print"
17
- end
@@ -1,69 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activesupport (3.2.9)
5
- i18n (~> 0.6)
6
- multi_json (~> 1.0)
7
- awesome_print (1.1.0)
8
- clamp (0.5.0)
9
- clipboard (1.0.1)
10
- drydock (0.6.9)
11
- git (1.2.5)
12
- httparty (0.9.0)
13
- multi_json (~> 1.0)
14
- multi_xml
15
- i18n (0.6.1)
16
- jeweler (1.8.4)
17
- bundler (~> 1.0)
18
- git (>= 1.2.5)
19
- rake
20
- rdoc
21
- json (1.7.5)
22
- multi_json (1.3.7)
23
- multi_xml (0.5.1)
24
- onetime (0.4.0)
25
- drydock (>= 0.6.9)
26
- httparty (>= 0.7.7)
27
- json (>= 1.6.4)
28
- paint (0.8.5)
29
- pbkdf2 (0.1.0)
30
- pws (1.0.4)
31
- clipboard (~> 1.0.1)
32
- paint (>= 0.8.4)
33
- pbkdf2
34
- zucker (>= 12.1)
35
- qrcli (0.0.1)
36
- rqrcode
37
- rake (10.0.1)
38
- rcov (0.9.11)
39
- rdoc (3.12)
40
- json (~> 1.4)
41
- rqrcode (0.4.2)
42
- shoulda (3.3.2)
43
- shoulda-context (~> 1.0.1)
44
- shoulda-matchers (~> 1.4.1)
45
- shoulda-context (1.0.1)
46
- shoulda-matchers (1.4.1)
47
- activesupport (>= 3.0.0)
48
- simplecov (0.7.1)
49
- multi_json (~> 1.0)
50
- simplecov-html (~> 0.7.1)
51
- simplecov-html (0.7.1)
52
- zucker (12.1)
53
-
54
- PLATFORMS
55
- ruby
56
-
57
- DEPENDENCIES
58
- awesome_print
59
- bundler (> 1.0.0)
60
- clamp
61
- clipboard
62
- jeweler (~> 1.8.4)
63
- onetime
64
- pws
65
- qrcli
66
- rcov
67
- rdoc (~> 3.12)
68
- shoulda
69
- simplecov
@@ -1,20 +0,0 @@
1
- Copyright (c) 2012 Smile @rT
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,27 +0,0 @@
1
- = pwsqr
2
-
3
- This gem helps you securely and easily copy passwords from terminal pws tool, to your mobile devices using QR codes.
4
-
5
- PWS gem (https://github.com/janlelis/pws) is required to use this tool and will be installed as dependency if you doesn't has one already.
6
-
7
- By default pwsqr works offline and trying to use onetimesecret.com service to store your password privately behind QR code with short URL.
8
- To use this feature, run pwsqr with '$ pwsqr init' command first and setup your email and API key in newly generated config
9
- file in your $HOME directory: ~/.pwsqr
10
-
11
- For more options run '$ pwsqr --help' command.
12
-
13
- == Contributing to pwsqr
14
-
15
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
16
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
17
- * Fork the project.
18
- * Start a feature/bugfix branch.
19
- * Commit and push until you are happy with your contribution.
20
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
21
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
22
-
23
- == Copyright
24
-
25
- Copyright (c) 2012 Smile @rT. See LICENSE.txt for
26
- further details.
27
-
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.1
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestPwsqr < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end