lastpass-buddy 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 56b8851e00c6de6891f5ce233edc7e51e426be3d
4
+ data.tar.gz: c4b8dd49280514df13223072307a343d4492c641
5
+ SHA512:
6
+ metadata.gz: d655ddce8b901886874825fdd4614dbb9b5597dd97c54823a58ed2e2cafaea9cd884783f78b19e067afa79f2f18ee96c92ab5bfd52c866b47ee246400b92babe
7
+ data.tar.gz: 841b0250381c441b7ace6f3f447e6366837849f7034f1226082011a9128f39fce8dd36487aecac048b0defbc8efe6739bcf3389fc0239360cc490c4d540fb148
data/.gitignore ADDED
@@ -0,0 +1,50 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,60 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pivotal-lastpass-buddy (0.0.1)
5
+ gli (= 2.14.0)
6
+ highline (~> 1.7)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ aruba (0.14.1)
12
+ childprocess (~> 0.5.6)
13
+ contracts (~> 0.9)
14
+ cucumber (>= 1.3.19)
15
+ ffi (~> 1.9.10)
16
+ rspec-expectations (>= 2.99)
17
+ thor (~> 0.19)
18
+ builder (3.2.2)
19
+ childprocess (0.5.9)
20
+ ffi (~> 1.0, >= 1.0.11)
21
+ contracts (0.14.0)
22
+ cucumber (2.4.0)
23
+ builder (>= 2.1.2)
24
+ cucumber-core (~> 1.5.0)
25
+ cucumber-wire (~> 0.0.1)
26
+ diff-lcs (>= 1.1.3)
27
+ gherkin (~> 4.0)
28
+ multi_json (>= 1.7.5, < 2.0)
29
+ multi_test (>= 0.1.2)
30
+ cucumber-core (1.5.0)
31
+ gherkin (~> 4.0)
32
+ cucumber-wire (0.0.1)
33
+ diff-lcs (1.2.5)
34
+ ffi (1.9.14)
35
+ gherkin (4.0.0)
36
+ gli (2.14.0)
37
+ highline (1.7.8)
38
+ json (1.8.3)
39
+ multi_json (1.12.1)
40
+ multi_test (0.1.2)
41
+ rake (11.2.2)
42
+ rdoc (4.2.2)
43
+ json (~> 1.4)
44
+ rspec-expectations (3.5.0)
45
+ diff-lcs (>= 1.2.0, < 2.0)
46
+ rspec-support (~> 3.5.0)
47
+ rspec-support (3.5.0)
48
+ thor (0.19.1)
49
+
50
+ PLATFORMS
51
+ ruby
52
+
53
+ DEPENDENCIES
54
+ aruba
55
+ pivotal-lastpass-buddy!
56
+ rake
57
+ rdoc
58
+
59
+ BUNDLED WITH
60
+ 1.12.5
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 David Laing
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.
data/README.rdoc ADDED
@@ -0,0 +1,10 @@
1
+ = lastpass-buddy
2
+
3
+ *lastpass-buddy* captures context so it can be copied between teams
4
+
5
+ === Install
6
+
7
+ gem install pivotal-lastpass-buddy
8
+
9
+ :include:lastpass-buddy.rdoc
10
+
data/Rakefile ADDED
@@ -0,0 +1,44 @@
1
+ require 'rake/clean'
2
+ require 'rubygems'
3
+ require 'rubygems/package_task'
4
+ require 'rdoc/task'
5
+ require 'cucumber'
6
+ require 'cucumber/rake/task'
7
+ Rake::RDocTask.new do |rd|
8
+ rd.main = "README.rdoc"
9
+ rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
10
+ rd.title = 'Your application title'
11
+ end
12
+
13
+ spec = eval(File.read('lastpass-buddy.gemspec'))
14
+
15
+ Gem::PackageTask.new(spec) do |pkg|
16
+ end
17
+ CUKE_RESULTS = 'results.html'
18
+ CLEAN << CUKE_RESULTS
19
+ desc 'Run features'
20
+ Cucumber::Rake::Task.new(:features) do |t|
21
+ opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
22
+ opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
23
+ t.cucumber_opts = opts
24
+ t.fork = false
25
+ end
26
+
27
+ desc 'Run features tagged as work-in-progress (@wip)'
28
+ Cucumber::Rake::Task.new('features:wip') do |t|
29
+ tag_opts = ' --tags ~@pending'
30
+ tag_opts = ' --tags @wip'
31
+ t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
32
+ t.fork = false
33
+ end
34
+
35
+ task :cucumber => :features
36
+ task 'cucumber:wip' => 'features:wip'
37
+ task :wip => 'features:wip'
38
+ require 'rake/testtask'
39
+ Rake::TestTask.new do |t|
40
+ t.libs << "test"
41
+ t.test_files = FileList['test/*_test.rb']
42
+ end
43
+
44
+ task :default => [:test,:features]
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gli'
3
+ require 'lastpass-buddy'
4
+ require 'tempfile'
5
+ require 'highline/import'
6
+
7
+ include GLI::App
8
+
9
+ program_desc 'lastpass-buddy captures context so it can be copied between teams'
10
+
11
+ version Sophia::VERSION
12
+
13
+ subcommand_option_handling :normal
14
+ arguments :strict
15
+
16
+ desc 'Commands that interact with LastPass'
17
+ command :lastpass do |c|
18
+
19
+ c.desc 'Pulls keys from your LastPass .ssh folder and ssh-add\'s them to your terminal session'
20
+ c.command :'ssh-add' do |add|
21
+ add.action do
22
+ `lpass ls ".ssh" --color=never`.split( /\r?\n/ ).each_with_index do | line, i |
23
+ next if i==0 # First line is folder
24
+ key_name, key_id = line.match(/\.ssh\/(.+?) \[id: (\d+)\]/i).captures
25
+ next unless agree("Add #{key_name}?")
26
+ ssh_key = `lpass show #{key_id} --notes`
27
+ ssh_key_file = Tempfile.new(['',"-#{key_name}"])
28
+ begin
29
+ ssh_key_file.write(ssh_key)
30
+ ssh_key_file.close
31
+ puts `ssh-add -t 32400 #{ssh_key_file.path}`
32
+ ensure
33
+ ssh_key_file.unlink
34
+ end
35
+ end
36
+ say("<%= color('Current ssh-agent keys:', BOLD) %>")
37
+ puts `ssh-add -l`
38
+ end
39
+ end
40
+
41
+ c.desc 'Stores a ssh key in the .ssh folder within LastPass'
42
+ c.command :'store-ssh-key' do |store|
43
+ store.action do
44
+ say %{<%= color('HOWTO: Store a ssh key in LastPass', BOLD) %>
45
+ 1. Create a LastPass folder named <%= color('.ssh', BOLD) %>
46
+ 2. Add a Generic Secure Note to this folder where the Secure Note:
47
+ 1. <%= color('Name', BOLD) %> is a descriptive name of the SSH key
48
+ 2. <%= color('Body', BOLD) %> is the contents of your SSH private key
49
+ 3. Repeat to store multiple keys
50
+ }
51
+ end
52
+ end
53
+ end
54
+
55
+ desc 'Commands related to Pivotal JumpBoxes'
56
+ command :jumpbox do |c|
57
+ c.desc 'Generate a new SSH key for use on the jumpbox'
58
+ c.command :'generate-ssh-key' do |store|
59
+ store.action do
60
+ puts %{
61
+ 1. git clone git@github.com:pivotal-cf/prod-keys.git
62
+ 2. /path/to/prod-keys/scripts/create-key
63
+ 3. Store the private key somewhere safe ( eg, LastPass; then use lastpass-buddy lastpass to fetch it)
64
+ 4. Commit the public portion of your key to the pivotal-cf/prod-keys repo
65
+ 5. Wait for the jumpboxes to roll
66
+ }
67
+ end
68
+ end
69
+ end
70
+
71
+ pre do |global,command,options,args|
72
+ # Pre logic here
73
+ # Return true to proceed; false to abort and not call the
74
+ # chosen command
75
+ # Use skips_pre before a command to skip this block
76
+ # on that command only
77
+ true
78
+ end
79
+
80
+ post do |global,command,options,args|
81
+ # Post logic here
82
+ # Use skips_post before a command to skip this
83
+ # block on that command only
84
+ end
85
+
86
+ on_error do |exception|
87
+ # Error logic here
88
+ # return false to skip default error handling
89
+ true
90
+ end
91
+
92
+ exit run(ARGV)
@@ -0,0 +1,8 @@
1
+ Feature: My bootstrapped app kinda works
2
+ In order to get going on coding my awesome app
3
+ I want to have aruba and cucumber setup
4
+ So I don't have to do it myself
5
+
6
+ Scenario: App just runs
7
+ When I get help for "lastpass-buddy"
8
+ Then the exit status should be 0
@@ -0,0 +1,6 @@
1
+ When /^I get help for "([^"]*)"$/ do |app_name|
2
+ @app_name = app_name
3
+ step %(I run `#{app_name} help`)
4
+ end
5
+
6
+ # Add more step definitions here
@@ -0,0 +1,15 @@
1
+ require 'aruba/cucumber'
2
+
3
+ ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
4
+ LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
5
+
6
+ Before do
7
+ # Using "announce" causes massive warnings on 1.9.2
8
+ @puts = true
9
+ @original_rubylib = ENV['RUBYLIB']
10
+ ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
11
+ end
12
+
13
+ After do
14
+ ENV['RUBYLIB'] = @original_rubylib
15
+ end
@@ -0,0 +1,25 @@
1
+ # Ensure we require the local version and not one we might have installed already
2
+ require File.join([File.dirname(__FILE__),'lib','lastpass-buddy','version.rb'])
3
+ spec = Gem::Specification.new do |s|
4
+ s.name = 'lastpass-buddy'
5
+ s.version = Sophia::VERSION
6
+ s.author = 'David Laing'
7
+ s.email = 'dlaing@pivotal.io'
8
+ s.homepage = 'http://your.website.com'
9
+ s.platform = Gem::Platform::RUBY
10
+ s.summary = 'lastpass-buddy does useful things using lastpass as a backing store'
11
+ s.licenses = ['MIT']
12
+ s.files = `git ls-files`.split("
13
+ ")
14
+ s.require_paths << 'lib'
15
+ s.has_rdoc = true
16
+ s.extra_rdoc_files = ['README.rdoc','lastpass-buddy.rdoc']
17
+ s.rdoc_options << '--title' << 'lastpass-buddy' << '--main' << 'README.rdoc' << '-ri'
18
+ s.bindir = 'bin'
19
+ s.executables << 'lastpass-buddy'
20
+ s.add_development_dependency('rake')
21
+ s.add_development_dependency('rdoc')
22
+ s.add_development_dependency('aruba')
23
+ s.add_runtime_dependency('gli','2.14.0')
24
+ s.add_runtime_dependency('highline','~> 1.7')
25
+ end
@@ -0,0 +1,5 @@
1
+ = lastpass-buddy
2
+
3
+ Generate this with
4
+ lastpass-buddy rdoc
5
+ After you have described your command line interface
@@ -0,0 +1,3 @@
1
+ module Sophia
2
+ VERSION = '0.0.2'
3
+ end
@@ -0,0 +1,4 @@
1
+ require 'lastpass-buddy/version.rb'
2
+
3
+ # Add requires for other files you add to your project here, so
4
+ # you just need to require this one file in your bin file
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class DefaultTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def teardown
9
+ end
10
+
11
+ def test_the_truth
12
+ assert true
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ require 'test/unit'
2
+
3
+ # Add test libraries you want to use here, e.g. mocha
4
+
5
+ class Test::Unit::TestCase
6
+
7
+ # Add global extensions to the test case class here
8
+
9
+ end
metadata ADDED
@@ -0,0 +1,138 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lastpass-buddy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - David Laing
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
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: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: aruba
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: gli
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.14.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.14.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: highline
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.7'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.7'
83
+ description:
84
+ email: dlaing@pivotal.io
85
+ executables:
86
+ - lastpass-buddy
87
+ extensions: []
88
+ extra_rdoc_files:
89
+ - README.rdoc
90
+ - lastpass-buddy.rdoc
91
+ files:
92
+ - ".gitignore"
93
+ - Gemfile
94
+ - Gemfile.lock
95
+ - LICENSE
96
+ - README.rdoc
97
+ - Rakefile
98
+ - bin/lastpass-buddy
99
+ - features/lastpass-buddy.feature
100
+ - features/step_definitions/sophia_steps.rb
101
+ - features/support/env.rb
102
+ - lastpass-buddy.gemspec
103
+ - lastpass-buddy.rdoc
104
+ - lib/lastpass-buddy.rb
105
+ - lib/lastpass-buddy/version.rb
106
+ - test/default_test.rb
107
+ - test/test_helper.rb
108
+ homepage: http://your.website.com
109
+ licenses:
110
+ - MIT
111
+ metadata: {}
112
+ post_install_message:
113
+ rdoc_options:
114
+ - "--title"
115
+ - lastpass-buddy
116
+ - "--main"
117
+ - README.rdoc
118
+ - "-ri"
119
+ require_paths:
120
+ - lib
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ requirements: []
133
+ rubyforge_project:
134
+ rubygems_version: 2.4.5.1
135
+ signing_key:
136
+ specification_version: 4
137
+ summary: lastpass-buddy does useful things using lastpass as a backing store
138
+ test_files: []