jetbrains 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: 8bb1115807d904fc0365e6125028037fcbb08e17
4
+ data.tar.gz: b6875c2aad436af76f4762fc29e82cff1f857de4
5
+ SHA512:
6
+ metadata.gz: 5aa972f56d9d02d23b5efdf9af39e5f7a769346aea63dc6bd51f2437f0b250d572b87a0b74dfb2edea5b9156136bd454a199e82cbae74c16190997576d0e4c5a
7
+ data.tar.gz: 4c34ebd6ef2c5667d7c7c565b500bfb16d7c8a9166b52b21755b2eb0470ce00062d3408aec41e59305da94e21da7f90a587ea92f29886a349283e5ec1fb3e89c
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jetbrains.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Cormac Cannon
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # Jetbrains Toolbox Application Launcher
2
+
3
+ Find and launch Jetbrains IDEs installed using the toolbox from the command line.
4
+
5
+ Searches default (Linux) Jetbrains Toolbox installation path for latest installation of a given Jetbrains IDE. e.g. 'jetbrains clion' or 'jetbrains idea'.
6
+
7
+ Minimally tested on my own installation, i.e.
8
+
9
+ * Arch Linux
10
+ * Toolbox version 1.0.2002
11
+ * Current and EAP releases of IDEA and CLion installed
12
+
13
+
14
+
15
+ ## Installation
16
+
17
+ $ gem install jetbrains
18
+
19
+ ## Usage
20
+
21
+ $ jetbrains <app-name>
22
+
23
+ where the app-name is the prefix of the *.sh launcher included in the app's bin folder.
24
+ These are `idea.sh` and `clion.sh` for the two I use. i.e.
25
+
26
+ $ jetbrains idea
27
+
28
+ or
29
+
30
+ $ jetbrains clion
31
+
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/cormacc/jetbrains
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
@@ -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 "jetbrains"
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
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/ruby
2
+ require 'jetbrains'
3
+
4
+ if ARGV.length == 1
5
+ Jetbrains::Launcher.new(ARGV[0])
6
+ else
7
+ puts "Usage: 'jetbrains <appname>', where <appname> is one of 'clion','idea','rubymine' etc..."
8
+ puts "e.g. 'jetbrains clion' to find/launch latest toolbox installation of the CLion IDE"
9
+ end
@@ -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,35 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jetbrains/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "jetbrains"
8
+ spec.version = Jetbrains::VERSION
9
+ spec.authors = ["Cormac Cannon"]
10
+ spec.email = ["cormacc.public@gmail.com"]
11
+
12
+ spec.summary = %q{Find and launch Jetbrains IDEs installed using the toolbox from the command line.}
13
+ spec.description = %q{Searches default (Linux) Jetbrains Toolbox installation path for latest installation of a given Jetbrains IDE. e.g. 'jetbrains clion' or 'jetbrains idea'}
14
+ spec.homepage = "http://rubygems.org/gems/jetbrains"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against " \
23
+ "public gem pushes."
24
+ end
25
+
26
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features)/})
28
+ end
29
+ spec.bindir = "bin"
30
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+ spec.add_development_dependency "bundler", "~> 1.13"
34
+ spec.add_development_dependency "rake", "~> 10.0"
35
+ end
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/ruby
2
+ require 'pathname'
3
+
4
+ ##
5
+ # This module provides utilities to manage Jetbrains IDEs installed using the
6
+ # Jetbrains Toolbox application from the command line
7
+ module Jetbrains
8
+ DEFAULT_INSTALLATION_ROOT = Pathname.new('~/.local/share/JetBrains/Toolbox').expand_path
9
+ @installation_root = DEFAULT_INSTALLATION_ROOT
10
+ @app_root = DEFAULT_INSTALLATION_ROOT + 'apps'
11
+ class << self
12
+ attr_reader :installation_root, :app_root
13
+ def installation_root(new_root)
14
+ raise ArgumentError, "Installation root '#{new_root}' not found" unless Pathname.new(new_root).is_directory?
15
+ @installation_root = new_root
16
+ end
17
+ end
18
+
19
+ ##
20
+ # Launches the most recent version found of the given jetbrains IDE
21
+ class Launcher
22
+ def initialize(name = 'idea')
23
+ candidates = Dir.glob("#{Jetbrains.app_root}/**/#{name}.sh").sort
24
+ raise ArgumentError, "No files named '#{name}.sh' found under '#{Jetbrains.app_root}" if candidates.empty?
25
+ if candidates.length > 1
26
+ puts 'Multiple candidates found...'
27
+ puts candidates
28
+ end
29
+ pid = spawn(candidates.last)
30
+ puts "Launched #{candidates.last} with pid #{pid}"
31
+ end
32
+ end
33
+ end
34
+
35
+ # Irrelevant in a gem context, but allows script to be used standalone
36
+ if __FILE__ == $PROGRAM_NAME
37
+ if ARGV.length == 1
38
+ Jetbrains::Launcher.new(ARGV[0])
39
+ else
40
+ puts "Usage: 'jetbrains <appname>', where <appname> is one of 'clion','idea','rubymine' etc..."
41
+ puts "e.g. 'jetbrains clion' to find/launch latest toolbox installation of the CLion IDE"
42
+ end
43
+ end
@@ -0,0 +1,3 @@
1
+ module Jetbrains
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jetbrains
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Cormac Cannon
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-27 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.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
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
+ description: Searches default (Linux) Jetbrains Toolbox installation path for latest
42
+ installation of a given Jetbrains IDE. e.g. 'jetbrains clion' or 'jetbrains idea'
43
+ email:
44
+ - cormacc.public@gmail.com
45
+ executables:
46
+ - console
47
+ - jetbrains
48
+ - setup
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - ".gitignore"
53
+ - Gemfile
54
+ - LICENSE.txt
55
+ - README.md
56
+ - Rakefile
57
+ - bin/console
58
+ - bin/jetbrains
59
+ - bin/setup
60
+ - jetbrains.gemspec
61
+ - lib/jetbrains.rb
62
+ - lib/jetbrains/version.rb
63
+ homepage: http://rubygems.org/gems/jetbrains
64
+ licenses:
65
+ - MIT
66
+ metadata:
67
+ allowed_push_host: https://rubygems.org
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.5.1
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Find and launch Jetbrains IDEs installed using the toolbox from the command
88
+ line.
89
+ test_files: []