vagrant-rubymine 0.0.4
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 +19 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +22 -0
- data/README.md +64 -0
- data/Rakefile +10 -0
- data/lib/vagrant/rubymine.rb +10 -0
- data/lib/vagrant/rubymine/bash_profile.rb +33 -0
- data/lib/vagrant/rubymine/config.rb +15 -0
- data/lib/vagrant/rubymine/middleware.rb +62 -0
- data/lib/vagrant/rubymine/plugin.rb +27 -0
- data/lib/vagrant/rubymine/rubymine_conf.rb +83 -0
- data/lib/vagrant/rubymine/version.rb +5 -0
- data/test/.test_rubymine_config_dir/config/options/gemmanager.xml +1425 -0
- data/test/.test_rubymine_config_dir/config/options/other.xml +66 -0
- data/test/test_bash_profile.rb +37 -0
- data/test/test_rubymine_conf.rb +41 -0
- data/vagrant-rubymine.gemspec +20 -0
- metadata +66 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<application>
|
|
2
|
+
<component name="ExternalResourceManagerImpl">
|
|
3
|
+
<ignored-resource url="http://relaxng.org/ns/compatibility/annotations/1.0" />
|
|
4
|
+
<ignored-resource url="http://www.w3.org/1998/Math/MathML" />
|
|
5
|
+
<ignored-resource url="http://www.w3.org/2000/svg" />
|
|
6
|
+
</component>
|
|
7
|
+
<component name="RecentDirectoryProjectsManager">
|
|
8
|
+
<option name="recentPaths">
|
|
9
|
+
<list>
|
|
10
|
+
<option value="C:\Users\Bartosz\Development\workspace\vagrant-rubymine" />
|
|
11
|
+
<option value="C:\Users\Bartosz\Development\workspace\merca" />
|
|
12
|
+
<option value="C:\Users\Bartosz\Development\workspace\vagrant-rubymine-env" />
|
|
13
|
+
<option value="C:\Users\Bartosz\Development\workspace\vagrant-rubymine-env-test" />
|
|
14
|
+
<option value="C:\Users\Bartosz\Development\workspace\vagrant-host-path" />
|
|
15
|
+
<option value="C:\Users\Bartosz\Development\workspace\test" />
|
|
16
|
+
</list>
|
|
17
|
+
</option>
|
|
18
|
+
<option name="lastPath" value="C:\Users\Bartosz\Development\workspace\vagrant-rubymine" />
|
|
19
|
+
</component>
|
|
20
|
+
<component name="Registry">
|
|
21
|
+
<entry key="ide.firstStartup" value="false" />
|
|
22
|
+
</component>
|
|
23
|
+
<component name="TemplateSettings">
|
|
24
|
+
<defaultShortcut shortcut="TAB" />
|
|
25
|
+
</component>
|
|
26
|
+
<component name="TodoConfiguration">
|
|
27
|
+
<pattern icon="default" useCustomColors="false" case-sensitive="false" pattern="\btodo\b.*">
|
|
28
|
+
<option name="FOREGROUND" value="a8c023" />
|
|
29
|
+
<option name="FONT_TYPE" value="2" />
|
|
30
|
+
<option name="ERROR_STRIPE_COLOR" value="a74c0" />
|
|
31
|
+
<option name="EFFECT_TYPE" value="0" />
|
|
32
|
+
</pattern>
|
|
33
|
+
<pattern icon="default" useCustomColors="false" case-sensitive="false" pattern="\bfixme\b.*">
|
|
34
|
+
<option name="FOREGROUND" value="a8c023" />
|
|
35
|
+
<option name="FONT_TYPE" value="2" />
|
|
36
|
+
<option name="ERROR_STRIPE_COLOR" value="a74c0" />
|
|
37
|
+
<option name="EFFECT_TYPE" value="0" />
|
|
38
|
+
</pattern>
|
|
39
|
+
</component>
|
|
40
|
+
<component name="XDebuggerSettings">
|
|
41
|
+
<data-views />
|
|
42
|
+
<general />
|
|
43
|
+
<debuggers>
|
|
44
|
+
<debugger id="ruby">
|
|
45
|
+
<configuration />
|
|
46
|
+
</debugger>
|
|
47
|
+
<debugger id="ObjectiveC">
|
|
48
|
+
<configuration />
|
|
49
|
+
</debugger>
|
|
50
|
+
<debugger id="javascript">
|
|
51
|
+
<configuration>
|
|
52
|
+
<custom-object-presentation />
|
|
53
|
+
</configuration>
|
|
54
|
+
</debugger>
|
|
55
|
+
</debuggers>
|
|
56
|
+
</component>
|
|
57
|
+
<component name="com.intellij.ide.fileTemplates.impl.FileTemplateManagerImpl">
|
|
58
|
+
<recent_templates>
|
|
59
|
+
<option name="RECENT_TEMPLATES">
|
|
60
|
+
<value>
|
|
61
|
+
<list size="0" />
|
|
62
|
+
</value>
|
|
63
|
+
</option>
|
|
64
|
+
</recent_templates>
|
|
65
|
+
</component>
|
|
66
|
+
</application>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'vagrant/rubymine/bash_profile'
|
|
3
|
+
|
|
4
|
+
class BashProfileTest < Test::Unit::TestCase
|
|
5
|
+
|
|
6
|
+
BASH_PROFILE_PATH = '.bash_profile'
|
|
7
|
+
|
|
8
|
+
def setup
|
|
9
|
+
@bash_profile = ::Vagrant::Rubymine::BashProfile.new(BASH_PROFILE_PATH)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def test_creating_profile
|
|
13
|
+
@bash_profile.create_profile
|
|
14
|
+
commands = @bash_profile.instance_variable_get('@commands')
|
|
15
|
+
|
|
16
|
+
assert_equal ['rm -f .bash_profile', 'touch .bash_profile'], commands
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def test_adding_and_applying_commands
|
|
20
|
+
@bash_profile.add_command('test_command1')
|
|
21
|
+
@bash_profile.add_command('test_command2')
|
|
22
|
+
|
|
23
|
+
commands = []
|
|
24
|
+
@bash_profile.apply do |command|
|
|
25
|
+
commands << command
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
assert_equal ['echo "test_command1" >> ".bash_profile"', 'echo "test_command2" >> ".bash_profile"'], commands
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def test_escaping_shell
|
|
32
|
+
escaped = @bash_profile.send(:escape_shell, 'test"`\\')
|
|
33
|
+
|
|
34
|
+
assert_equal 'test\\"\\`\\\\', escaped
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require 'vagrant/rubymine/rubymine_conf'
|
|
3
|
+
|
|
4
|
+
class RubymineConfTest < Test::Unit::TestCase
|
|
5
|
+
TEST_CONFIG_PATH = 'test'
|
|
6
|
+
|
|
7
|
+
def setup
|
|
8
|
+
@rubymine_conf = ::Vagrant::Rubymine::RubymineConf.new('test/.test_rubymine_config_dir')
|
|
9
|
+
ENV['USERPROFILE'] = TEST_CONFIG_PATH
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def test_incorrect_config_path
|
|
13
|
+
assert_raise ::Vagrant::Rubymine::ConfigNotFound do
|
|
14
|
+
::Vagrant::Rubymine::RubymineConf.new('fake')
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def test_detecting_file
|
|
19
|
+
config_path = @rubymine_conf.instance_variable_get('@root_path')
|
|
20
|
+
assert Dir.exists?(config_path)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def test_validation
|
|
24
|
+
assert @rubymine_conf.valid?
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def test_getting_gems_paths
|
|
28
|
+
gems_paths = @rubymine_conf.gems_paths
|
|
29
|
+
assert_equal "#{ENV['USERPROFILE']}\\.rubymine70\\system\\ruby_stubs\\-1898370286\\-1715081484\\gems", gems_paths['merca']
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def test_getting_project_paths
|
|
33
|
+
project_paths = @rubymine_conf.projects_paths
|
|
34
|
+
assert_equal 'c:\\users\\bartosz\\development\\workspace\\merca', project_paths['merca']
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def test_normalization
|
|
38
|
+
normalized_project_name = @rubymine_conf.send(:normalize_project_name, 'test-project')
|
|
39
|
+
assert_equal 'test_project', normalized_project_name
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'vagrant/rubymine/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = 'vagrant-rubymine'
|
|
8
|
+
spec.version = Vagrant::Rubymine::VERSION
|
|
9
|
+
spec.authors = ['bjarosze']
|
|
10
|
+
spec.email = ['b.jarosze@gmail.com']
|
|
11
|
+
spec.summary = 'Vagrant plugin that creates environment variables with paths to Rubymine projects on guest machine.'
|
|
12
|
+
spec.description = 'Creates environment variables with paths to Rubymine projects.'
|
|
13
|
+
spec.homepage = 'https://github.com/bjarosze/vagrant-rubymine'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ['lib']
|
|
20
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: vagrant-rubymine
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.4
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- bjarosze
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-07-04 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Creates environment variables with paths to Rubymine projects.
|
|
14
|
+
email:
|
|
15
|
+
- b.jarosze@gmail.com
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- .gitignore
|
|
21
|
+
- Gemfile
|
|
22
|
+
- LICENSE.txt
|
|
23
|
+
- README.md
|
|
24
|
+
- Rakefile
|
|
25
|
+
- lib/vagrant/rubymine.rb
|
|
26
|
+
- lib/vagrant/rubymine/bash_profile.rb
|
|
27
|
+
- lib/vagrant/rubymine/config.rb
|
|
28
|
+
- lib/vagrant/rubymine/middleware.rb
|
|
29
|
+
- lib/vagrant/rubymine/plugin.rb
|
|
30
|
+
- lib/vagrant/rubymine/rubymine_conf.rb
|
|
31
|
+
- lib/vagrant/rubymine/version.rb
|
|
32
|
+
- test/.test_rubymine_config_dir/config/options/gemmanager.xml
|
|
33
|
+
- test/.test_rubymine_config_dir/config/options/other.xml
|
|
34
|
+
- test/test_bash_profile.rb
|
|
35
|
+
- test/test_rubymine_conf.rb
|
|
36
|
+
- vagrant-rubymine.gemspec
|
|
37
|
+
homepage: https://github.com/bjarosze/vagrant-rubymine
|
|
38
|
+
licenses:
|
|
39
|
+
- MIT
|
|
40
|
+
metadata: {}
|
|
41
|
+
post_install_message:
|
|
42
|
+
rdoc_options: []
|
|
43
|
+
require_paths:
|
|
44
|
+
- lib
|
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
|
+
requirements:
|
|
47
|
+
- - '>='
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: '0'
|
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - '>='
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
requirements: []
|
|
56
|
+
rubyforge_project:
|
|
57
|
+
rubygems_version: 2.0.14
|
|
58
|
+
signing_key:
|
|
59
|
+
specification_version: 4
|
|
60
|
+
summary: Vagrant plugin that creates environment variables with paths to Rubymine
|
|
61
|
+
projects on guest machine.
|
|
62
|
+
test_files:
|
|
63
|
+
- test/.test_rubymine_config_dir/config/options/gemmanager.xml
|
|
64
|
+
- test/.test_rubymine_config_dir/config/options/other.xml
|
|
65
|
+
- test/test_bash_profile.rb
|
|
66
|
+
- test/test_rubymine_conf.rb
|