static_cms 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,13 +4,13 @@ class ::StaticCms::Application < Thor
4
4
  require 'ruby_patch'
5
5
  extend ::RubyPatch::AutoLoad
6
6
 
7
- desc "init [DIR]", "Initialize DIR directory for StaticCms [default: .]."
7
+ desc "init [DIR='.']", "Initialize DIR directory for StaticCms"
8
8
  def init(dir = '.')
9
9
  ::StaticCms::Commands.init(dir)
10
10
  end
11
11
 
12
- desc "update", "Update templates, sources, statics (and more)."
13
- def update
14
- ::StaticCms::Commands.update
12
+ desc "update [DIR='.']", "Update templates, sources, statics (and more)."
13
+ def update(dir = '.')
14
+ ::StaticCms::Commands.update(dir)
15
15
  end
16
16
  end
@@ -21,11 +21,12 @@ git commit -m 'Copied from site template.' > #{File::NULL}
21
21
  success
22
22
  end
23
23
 
24
- def self.update
25
- site_template_dir = File.join(__DIR__, '../data/site_template')
26
- FileUtils.cp_r(File.join(site_template_dir, 'templates'), '.')
27
- FileUtils.cp_r(File.join(site_template_dir, 'sources'), '.')
28
- FileUtils.cp_r(File.join(site_template_dir, 'statics'), '.')
29
- FileUtils.cp(File.join(site_template_dir, 'rakefile'), '.')
24
+ def self.update(dir = '.')
25
+ FileUtils.cp_r(File.join(SITE_TEMPLATE_DIR, 'templates'), dir)
26
+ FileUtils.cp_r(File.join(SITE_TEMPLATE_DIR, 'sources'), dir)
27
+ FileUtils.cp_r(File.join(SITE_TEMPLATE_DIR, 'statics'), dir)
28
+ FileUtils.cp(File.join(SITE_TEMPLATE_DIR, 'rakefile'), dir)
29
+
30
+ true
30
31
  end
31
32
  end
@@ -1,3 +1,3 @@
1
1
  module ::StaticCms
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
@@ -1,3 +1,5 @@
1
1
  require 'minitest/autorun'
2
2
 
3
+ require 'ruby_patch'
4
+ require 'fileutils'
3
5
  require 'static_cms'
@@ -1,6 +1,4 @@
1
1
  require 'helper_for_test'
2
- require 'fileutils'
3
- require 'ruby_patch'
4
2
 
5
3
  class TestGenerate < ::MiniTest::Unit::TestCase
6
4
  def test_generate
data/test/test_init.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'helper_for_test'
2
2
 
3
- class TestInitAndGenerate < ::MiniTest::Unit::TestCase
3
+ class TestInit < ::MiniTest::Unit::TestCase
4
4
  require 'tmpdir'
5
5
 
6
6
  def test_init
@@ -0,0 +1,9 @@
1
+ require 'helper_for_test'
2
+
3
+ class TestUpdate < ::MiniTest::Unit::TestCase
4
+ require 'tmpdir'
5
+
6
+ def test_update
7
+ assert ::StaticCms::Commands.update(Dir.mktmpdir)
8
+ end
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: static_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml
16
- requirement: &84273480 !ruby/object:Gem::Requirement
16
+ requirement: &79450410 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *84273480
24
+ version_requirements: *79450410
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sass
27
- requirement: &84272190 !ruby/object:Gem::Requirement
27
+ requirement: &79238900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.2'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *84272190
35
+ version_requirements: *79238900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ruby_patch
38
- requirement: &84270960 !ruby/object:Gem::Requirement
38
+ requirement: &79237630 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.1'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *84270960
46
+ version_requirements: *79237630
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: thor
49
- requirement: &84269260 !ruby/object:Gem::Requirement
49
+ requirement: &79236320 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0.16'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *84269260
57
+ version_requirements: *79236320
58
58
  description: Simple static contents management system based on Haml and Sass.
59
59
  email:
60
60
  executables:
@@ -92,6 +92,7 @@ files:
92
92
  - test/helper_for_test.rb
93
93
  - test/test_generate.rb
94
94
  - test/test_init.rb
95
+ - test/test_update.rb
95
96
  homepage:
96
97
  licenses: []
97
98
  post_install_message:
@@ -119,4 +120,5 @@ summary: Simple static contents management system.
119
120
  test_files:
120
121
  - test/test_generate.rb
121
122
  - test/test_init.rb
123
+ - test/test_update.rb
122
124
  has_rdoc: