serverkit-atom 0.0.1

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
+ SHA1:
3
+ metadata.gz: 3c5033850a3ba0a9437adbe09c060147037f1ff5
4
+ data.tar.gz: 6a171b699c95c536cf2486e365a03363b2bddf67
5
+ SHA512:
6
+ metadata.gz: 2eb438509e163287640046a0548fa7500c24200ae1b6f6d1561ea874d7cac55e6ea0cf0c64cd5580d084331c2cda86091714c89bf610990601fea169084a9569
7
+ data.tar.gz: 945707c1aff01e407c547860448f7341677e0310ee56f6e224a59bd199c53198e038c002fd63edcc256083e311f0707721f54f2d4edabe6dd787b5c742c4b957
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Ryo Nakamura
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,26 @@
1
+ # serverkit-atom
2
+ [Serverkit](https://github.com/r7kamura/serverkit) plug-in for [Atom](https://atom.io/).
3
+
4
+ ## Install
5
+ ```rb
6
+ # Gemfile
7
+ gem "serverkit-atom"
8
+ ```
9
+
10
+ ## Resource
11
+ ### atom_package
12
+ Install specified atom package.
13
+
14
+ #### Attributes
15
+ - name - package name (required)
16
+ - version - package version (optional)
17
+
18
+ #### Example
19
+ ```yaml
20
+ resources:
21
+ - type: atom_package
22
+ name: sort-lines
23
+ - type: atom_package
24
+ name: vim-mode
25
+ version: 0.43.0
26
+ ```
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,2 @@
1
+ require "serverkit/atom/version"
2
+ require "serverkit/resources/atom_package"
@@ -0,0 +1,5 @@
1
+ module Serverkit
2
+ module Atom
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,47 @@
1
+ require "serverkit/resources/base"
2
+
3
+ module Serverkit
4
+ module Resources
5
+ class AtomPackage < Base
6
+ attribute :name, required: true, type: String
7
+ attribute :version, type: String
8
+
9
+ # @note Override
10
+ def apply
11
+ run_command("apm install #{name_with_version}")
12
+ end
13
+
14
+ # @note Override
15
+ def check
16
+ check_command("apm list --bare --installed #{name} | grep -E '#{name_pattern_with_version}'")
17
+ end
18
+
19
+ private
20
+
21
+ # @note Override
22
+ def default_id
23
+ name
24
+ end
25
+
26
+ # @return [String]
27
+ # @example "^git-plus@4.4.11$"
28
+ def name_pattern_with_version
29
+ if version
30
+ "^#{name}@#{version}$"
31
+ else
32
+ "^#{name}@"
33
+ end
34
+ end
35
+
36
+ # @return [String]
37
+ # @example "git-plus@4.4.11"
38
+ def name_with_version
39
+ if version
40
+ "#{name}@#{version}"
41
+ else
42
+ name
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,22 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "serverkit/atom/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "serverkit-atom"
7
+ spec.version = Serverkit::Atom::VERSION
8
+ spec.authors = ["Ryo Nakamura"]
9
+ spec.email = ["r7kamura@gmail.com"]
10
+ spec.summary = "Serverkit plug-in for Atom."
11
+ spec.homepage = "https://github.com/r7kamura/serverkit-atom"
12
+ spec.license = "MIT"
13
+
14
+ spec.files = `git ls-files -z`.split("\x0")
15
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_runtime_dependency "serverkit"
20
+ spec.add_development_dependency "bundler", "~> 1.7"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: serverkit-atom
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ryo Nakamura
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: serverkit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
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: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description:
56
+ email:
57
+ - r7kamura@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/serverkit/atom.rb
68
+ - lib/serverkit/atom/version.rb
69
+ - lib/serverkit/resources/atom_package.rb
70
+ - serverkit-atom.gemspec
71
+ homepage: https://github.com/r7kamura/serverkit-atom
72
+ licenses:
73
+ - MIT
74
+ metadata: {}
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubyforge_project:
91
+ rubygems_version: 2.4.5
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: Serverkit plug-in for Atom.
95
+ test_files: []
96
+ has_rdoc: