dir_dsl 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -18,4 +18,8 @@
18
18
 
19
19
  == Version 1.0.4
20
20
 
21
- * Adding version to gemspec.
21
+ * Adding version to gemspec.
22
+
23
+ == Version 1.0.5
24
+
25
+ * Changing meta_methods gem version.
data/Gemfile.lock CHANGED
@@ -1,24 +1,24 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- diff-lcs (1.2.4)
4
+ diff-lcs (1.2.5)
5
5
  file_utils (1.0.7)
6
6
  gemcutter (0.7.1)
7
7
  gemspec_deps_gen (1.1.2)
8
8
  bundler
9
9
  file_utils
10
- meta_methods (1.0.6)
11
- metaclass (0.0.1)
12
- mocha (0.14.0)
10
+ meta_methods (1.1.0)
11
+ metaclass (0.0.4)
12
+ mocha (1.0.0)
13
13
  metaclass (~> 0.0.1)
14
14
  rspec (2.14.1)
15
15
  rspec-core (~> 2.14.0)
16
16
  rspec-expectations (~> 2.14.0)
17
17
  rspec-mocks (~> 2.14.0)
18
- rspec-core (2.14.5)
19
- rspec-expectations (2.14.3)
18
+ rspec-core (2.14.8)
19
+ rspec-expectations (2.14.5)
20
20
  diff-lcs (>= 1.1.3, < 2.0)
21
- rspec-mocks (2.14.3)
21
+ rspec-mocks (2.14.6)
22
22
 
23
23
  PLATFORMS
24
24
  ruby
data/README.md CHANGED
@@ -1,4 +1,66 @@
1
- dir_dsl
2
- =======
1
+ # DirDSL
3
2
 
4
- Library for working with files and directories (create, copy) in DSL-way
3
+ Library for working with files and directories (create, copy) in DSL-way
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'dir_dsl'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install dir_dsl
18
+
19
+ ## Usage
20
+
21
+ You can create new directory:
22
+
23
+ ```ruby
24
+ require 'dir_dsl'
25
+
26
+ from_dir = "."
27
+ to_dir = "build"
28
+
29
+ dir_builder = DirDSL.new from_dir, to_dir
30
+
31
+ dir_builder.build do
32
+ # files from 'from_dir'
33
+ file :name => "Gemfile"
34
+ file :name => "Rakefile", :to_dir => "my_config"
35
+ file :name => "spec/spec_helper.rb", :to_dir => "my_config"
36
+
37
+ # create empty directory
38
+ directory :to_dir => "my_config"
39
+
40
+ # copy from one directory to another
41
+ directory :from_dir => "spec", :to_dir => "my_spec"
42
+
43
+
44
+ # create zip entry from arbitrary source: string or StringIO
45
+ content :name => "README", :source => "My README file content"
46
+ end
47
+ ```
48
+
49
+ You can also display all entries from the folder:
50
+
51
+ ```ruby
52
+ ...
53
+
54
+ dir_builder.list("lib/zip_dsl")
55
+ ```
56
+
57
+ The idea is to build API identical to [ZipDSL] (https://github.com/shvets/zip_dsl), so you can use same API
58
+ for building zip files and copying files.
59
+
60
+ ## Contributing
61
+
62
+ 1. Fork it
63
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
64
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
65
+ 4. Push to the branch (`git push origin my-new-feature`)
66
+ 5. Create new Pull Request
@@ -1,9 +1,9 @@
1
1
  require 'file_utils/file_utils'
2
- require 'meta_methods/meta_methods'
2
+ require 'meta_methods'
3
3
 
4
4
  class DirDSL
5
5
  include FileUtils
6
- include MetaMethods
6
+ include MetaMethods::Core
7
7
 
8
8
  attr_reader :from_root, :to_root
9
9
 
@@ -1,3 +1,3 @@
1
1
  class DirDSL
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
data/lib/dir_dsl.rb CHANGED
@@ -1,2 +1 @@
1
1
  require 'dir_dsl/dir_dsl'
2
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dir_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-04 00:00:00.000000000 Z
11
+ date: 2014-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: file_utils
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  requirements: []
119
119
  rubyforge_project:
120
- rubygems_version: 2.1.2
120
+ rubygems_version: 2.2.2
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Library for working with files and directories file in DSL-way