xpm 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/xpm +11 -1
  3. data/lib/xpm/version.rb +1 -1
  4. data/lib/xpm/xp.rb +22 -3
  5. metadata +11 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa08229b3d0614cca639c2b607a2b8daa6fedb31
4
- data.tar.gz: 23eaa595495ba3a13f6a45a294167be251fb6b40
3
+ metadata.gz: 30130b8a902ed844d68b149a5362be594cf8155b
4
+ data.tar.gz: a0a92f898314815f2bff09b8f644b5a6646e5dd2
5
5
  SHA512:
6
- metadata.gz: c47a16eae30fa6fc67bfdeb51209cf1988f7d5104ab721462f3b3b63664a1858880610dfc70989d0540ace7802ce989107e6c33a2af23988a7b77f014fd4155a
7
- data.tar.gz: 57ab810ceab4bf1b1f4c1f4a09b444e497cb2d21c670d9cf71cacd937ca57682e77719309a9ccbffc5babee1b9986e9c62102f071452c45e34a7ceaccf0a2bb8
6
+ metadata.gz: 7a36afe81c45fd840d1b0e0d280233395010068b1189e0146cdc53313300fa89bd01605975cb58b0c76e5ece62fd2f491e72267997edc38d2881dbfaff1d54d5
7
+ data.tar.gz: e23e610f367b74379a8d22403b99fd25d6b10c877ab51d0d54edc89e11cd146efa3d61546ce6ec4e811e445b7d6525ba1e086ef2cc031c6d5b5024fa57a42fe6
data/bin/xpm CHANGED
@@ -21,7 +21,17 @@ require "xpm"
21
21
 
22
22
  class XPMCli < Thor
23
23
 
24
- desc "new [NAME]", "Create a new project called NAME in the current directory"
24
+ # This create a simple project (not a module)
25
+ # It is introduced in v 0.0.6 since I realized that self contained projects
26
+ # are easier to maintain and more reusable...
27
+ desc "init [NAME]", "Create a new xp5k project called NAME in the current directory"
28
+ def init(name)
29
+ xp = XPM::XP.new()
30
+ xp.init(name)
31
+ end
32
+
33
+ # This create a new module project (legacy)
34
+ desc "new [NAME]", "Create a new module project called NAME in the current directory"
25
35
  option :packages
26
36
  def new(name)
27
37
  xp = XPM::XP.new()
data/lib/xpm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module XPM
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/xpm/xp.rb CHANGED
@@ -12,9 +12,21 @@ module XPM
12
12
  @logger = options[:logger] || Logger.new(STDOUT)
13
13
  end
14
14
 
15
+ def init(name)
16
+ install("simple", name)
17
+ rvm(name)
18
+ end
19
+
15
20
  def new(name, *args)
16
- tarball = "master.tar.gz"
17
- url = "https://github.com/capi5k/capi5k-init/tarball/master"
21
+ install("master", name)
22
+ rvm(name)
23
+ end
24
+
25
+ private
26
+
27
+ def install(branch, name)
28
+ tarball = "#{branch}.tar.gz"
29
+ url = "https://github.com/capi5k/capi5k-init/tarball/#{branch}"
18
30
 
19
31
  @logger.info "Downloading project skeleton"
20
32
  # begin / rescue...
@@ -24,7 +36,7 @@ module XPM
24
36
  end
25
37
  end
26
38
 
27
- cmd = 'tar -xvzf master.tar.gz'
39
+ cmd = "tar -xvzf #{branch}.tar.gz"
28
40
  Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
29
41
  @logger.info "Extracting project skeleton"
30
42
  err = stderr.read
@@ -46,6 +58,13 @@ module XPM
46
58
 
47
59
  end # init
48
60
 
61
+ def rvm(name)
62
+ File.open("#{name}/.ruby-version", 'w') { |file| file.write("#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}") }
63
+ File.open("#{name}/.ruby-gemset", 'w') { |file| file.write("capi5k-#{name}") }
64
+ end
65
+
66
+
67
+
49
68
  end
50
69
  end
51
70
 
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - msimonin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-17 00:00:00.000000000 Z
11
+ date: 2015-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.19'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.19'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.8'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.8'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.6'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.6'
55
55
  description: xpm is a command line tool to control capi5k.
@@ -60,7 +60,7 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - ".gitignore"
63
+ - .gitignore
64
64
  - Gemfile
65
65
  - LICENSE.txt
66
66
  - README.md
@@ -84,12 +84,12 @@ require_paths:
84
84
  - lib
85
85
  required_ruby_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - ">="
92
+ - - '>='
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []