xssh-aws 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 32826a6e467ee5946ea832397769edfd010070a9e8779ffb981812ff12ff963c
4
+ data.tar.gz: eb1bdacbb1e23d804c503603cab5cd4b9abb4703f46eee80d120c1735299273c
5
+ SHA512:
6
+ metadata.gz: d9297522c28e5d96410a1506d9948c6b5cae11a52ff24d58dbf9195b6952cd2fb4bfa72d02fce6feb76548b9570e6e39ea0bae4162e5ce8d706c1c71095afafe
7
+ data.tar.gz: afccfc30d2c4470e81a915c9a5639e535f3d6b8e959b23c07c30cb07ef1991bc32460506d48d1fe878fb5801be654534bfb11108790c9943f328079ec3341053
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in xssh-aws.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
@@ -0,0 +1,92 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ xssh-aws (0.1.0)
5
+ aws-sdk-ec2 (~> 1.2)
6
+ xssh (~> 0.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.4.1)
12
+ aws-eventstream (1.1.0)
13
+ aws-partitions (1.381.0)
14
+ aws-sdk-core (3.109.1)
15
+ aws-eventstream (~> 1, >= 1.0.2)
16
+ aws-partitions (~> 1, >= 1.239.0)
17
+ aws-sigv4 (~> 1.1)
18
+ jmespath (~> 1.0)
19
+ aws-sdk-ec2 (1.200.0)
20
+ aws-sdk-core (~> 3, >= 3.109.0)
21
+ aws-sigv4 (~> 1.1)
22
+ aws-sigv4 (1.2.2)
23
+ aws-eventstream (~> 1, >= 1.0.2)
24
+ backport (1.1.2)
25
+ bcrypt_pbkdf (1.0.1)
26
+ benchmark (0.1.0)
27
+ e2mmap (0.1.0)
28
+ ed25519 (1.2.4)
29
+ jaro_winkler (1.5.4)
30
+ jmespath (1.4.0)
31
+ maruku (0.7.3)
32
+ mini_portile2 (2.4.0)
33
+ net-ssh (6.1.0)
34
+ net-ssh-gateway (2.0.0)
35
+ net-ssh (>= 4.0.0)
36
+ nokogiri (1.10.10)
37
+ mini_portile2 (~> 2.4.0)
38
+ parallel (1.19.2)
39
+ parser (2.7.2.0)
40
+ ast (~> 2.4.1)
41
+ rainbow (3.0.0)
42
+ rake (12.3.3)
43
+ regexp_parser (1.8.1)
44
+ reverse_markdown (2.0.0)
45
+ nokogiri
46
+ rexml (3.2.4)
47
+ rubocop (0.93.0)
48
+ parallel (~> 1.10)
49
+ parser (>= 2.7.1.5)
50
+ rainbow (>= 2.2.2, < 4.0)
51
+ regexp_parser (>= 1.8)
52
+ rexml
53
+ rubocop-ast (>= 0.6.0)
54
+ ruby-progressbar (~> 1.7)
55
+ unicode-display_width (>= 1.4.0, < 2.0)
56
+ rubocop-ast (0.7.1)
57
+ parser (>= 2.7.1.5)
58
+ ruby-progressbar (1.10.1)
59
+ solargraph (0.39.17)
60
+ backport (~> 1.1)
61
+ benchmark
62
+ bundler (>= 1.17.2)
63
+ e2mmap
64
+ jaro_winkler (~> 1.5)
65
+ maruku (~> 0.7, >= 0.7.3)
66
+ nokogiri (~> 1.9, >= 1.9.1)
67
+ parser (~> 2.3)
68
+ reverse_markdown (>= 1.0.5, < 3)
69
+ rubocop (~> 0.52)
70
+ thor (~> 1.0)
71
+ tilt (~> 2.0)
72
+ yard (~> 0.9, >= 0.9.24)
73
+ thor (1.0.1)
74
+ tilt (2.0.10)
75
+ unicode-display_width (1.7.0)
76
+ xssh (0.1.0)
77
+ bcrypt_pbkdf
78
+ ed25519
79
+ net-ssh
80
+ net-ssh-gateway
81
+ yard (0.9.25)
82
+
83
+ PLATFORMS
84
+ ruby
85
+
86
+ DEPENDENCIES
87
+ rake (~> 12.0)
88
+ solargraph
89
+ xssh-aws!
90
+
91
+ BUNDLED WITH
92
+ 2.1.4
@@ -0,0 +1,36 @@
1
+ # Xssh::Aws
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/xssh/aws`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'xssh-aws'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install xssh-aws
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ 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).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/xssh-aws.
36
+
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "xssh/aws"
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(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,34 @@
1
+ require 'aws-sdk-ec2'
2
+
3
+ module Xssh
4
+
5
+ def self.aws(**opts)
6
+ ::Aws.config.update(opts)
7
+ end
8
+
9
+ module Aws
10
+ class << self
11
+ def instance_souces(query='.*', **opts)
12
+ ec2 = ::Aws::EC2::Resource.new
13
+
14
+ ec2.instances.map do |i|
15
+ host = i.tags.find{|h| h.key == 'Name' }.value
16
+ next unless host =~ /#{query}/
17
+ next unless i.state.name == "running"
18
+
19
+ addr_type = opts[:address_type] || :public
20
+ type = opts[:type] || :linux
21
+
22
+ {
23
+ type: type,
24
+ host: host,
25
+ host_name: i.send("#{addr_type}_ip_address".to_sym),
26
+ instance_id: i.instance_id,
27
+ aws: i
28
+ }
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,5 @@
1
+ module Xssh
2
+ module Aws
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,33 @@
1
+ require_relative 'lib/xssh/aws/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "xssh-aws"
5
+ spec.version = Xssh::Aws::VERSION
6
+ spec.authors = ["gen"]
7
+ spec.email = ["ymdtshm@gmail.com"]
8
+
9
+ spec.summary = 'cross ssh client'
10
+ spec.description = 'cross ssh client'
11
+ spec.homepage = 'https://github.com/Gen-Arch/xssh-aws'
12
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
13
+
14
+
15
+ spec.metadata["homepage_uri"] = spec.homepage
16
+ spec.metadata["source_code_uri"] = spec.homepage
17
+
18
+ # Specify which files should be added to the gem when it is released.
19
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
21
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ end
23
+
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_runtime_dependency 'xssh', '~> 0.1'
29
+ spec.add_runtime_dependency 'aws-sdk-ec2', '~> 1.2'
30
+
31
+ spec.add_development_dependency 'solargraph'
32
+ spec.add_development_dependency 'rake'
33
+ end
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xssh-aws
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - gen
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-10-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: xssh
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sdk-ec2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: solargraph
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: rake
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
+ description: cross ssh client
70
+ email:
71
+ - ymdtshm@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - Gemfile.lock
79
+ - README.md
80
+ - Rakefile
81
+ - bin/console
82
+ - bin/setup
83
+ - lib/xssh/aws.rb
84
+ - lib/xssh/aws/version.rb
85
+ - xssh-aws.gemspec
86
+ homepage: https://github.com/Gen-Arch/xssh-aws
87
+ licenses: []
88
+ metadata:
89
+ homepage_uri: https://github.com/Gen-Arch/xssh-aws
90
+ source_code_uri: https://github.com/Gen-Arch/xssh-aws
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 2.3.0
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubygems_version: 3.1.2
107
+ signing_key:
108
+ specification_version: 4
109
+ summary: cross ssh client
110
+ test_files: []