vfs 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/readme.md +47 -41
  3. metadata +2 -2
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rake_ext'
2
2
 
3
3
  project(
4
4
  name: "vfs",
5
- version: "0.3.1",
5
+ gem: true,
6
6
  summary: "Virtual File System",
7
7
 
8
8
  author: "Alexey Petrushin",
data/readme.md CHANGED
@@ -22,70 +22,76 @@ ASAP by using copy+destroy approach, will be fixed as soon as I'll have free tim
22
22
 
23
23
  ## Installation
24
24
 
25
- $ gem install vfs
26
- $ gem install vos
25
+ ```bash
26
+ $ gem install vfs
27
+ $ gem install vos
28
+ ```
27
29
 
28
30
  ## Code samples:
29
- gem 'vfs' # Virtual File System
30
- require 'vfs'
31
31
 
32
- gem 'vos' # Virtual Operating System
33
- require 'vos'
32
+ ```ruby
33
+ gem 'vfs' # Virtual File System
34
+ require 'vfs'
34
35
 
36
+ gem 'vos' # Virtual Operating System
37
+ require 'vos'
35
38
 
36
- # Connections, let's deploy our 'cool_app' project from our local box to remote server
37
- server = Box.new('cool_app.com') # it will use id_rsa, or You can add {user: 'me', password: 'secret'}
38
- me = '~'.to_dir # handy shortcut for local FS
39
39
 
40
- deploy_dir = server['apps/cool_app']
41
- projects = me['projects']
40
+ # Connections, let's deploy our 'cool_app' project from our local box to remote server
41
+ server = Box.new('cool_app.com') # it will use id_rsa, or You can add {user: 'me', password: 'secret'}
42
+ me = '~'.to_dir # handy shortcut for local FS
42
43
 
44
+ deploy_dir = server['apps/cool_app']
45
+ projects = me['projects']
43
46
 
44
- # Working with dirs, copying dir from any source to any destination (local/remote/custom_storage_type)
45
- projects['cool_app'].copy_to deploy_dir
46
47
 
48
+ # Working with dirs, copying dir from any source to any destination (local/remote/custom_storage_type)
49
+ projects['cool_app'].copy_to deploy_dir
47
50
 
48
- # Working with files
49
- dbc = deploy_dir.file('config/database.yml') # <= the 'config' dir not exist yet
50
- dbc.write("user: root\npassword: secret") # <= now the 'database.yml' and parent 'config' has been created
51
- dbc.content =~ /database/ # => false, we forgot to add the database
52
- dbc.append("\ndatabase: mysql") # let's do it
53
51
 
54
- dbc.update do |content| # and add host info
55
- content + "\nhost: cool_app.com "
56
- end
52
+ # Working with files
53
+ dbc = deploy_dir.file('config/database.yml') # <= the 'config' dir not exist yet
54
+ dbc.write("user: root\npassword: secret") # <= now the 'database.yml' and parent 'config' has been created
55
+ dbc.content =~ /database/ # => false, we forgot to add the database
56
+ dbc.append("\ndatabase: mysql") # let's do it
57
57
 
58
- projects['cool_app/config/database.yml']. # or just overwrite it with our local dev version
59
- copy_to! dbc
60
-
61
- # there are also streaming support (read/write/append) with &block, please go to specs for details
58
+ dbc.update do |content| # and add host info
59
+ content + "\nhost: cool_app.com "
60
+ end
62
61
 
62
+ projects['cool_app/config/database.yml']. # or just overwrite it with our local dev version
63
+ copy_to! dbc
64
+
65
+ # there are also streaming support (read/write/append) with &block, please go to specs for details
63
66
 
64
- # Checks
65
- deploy_dir['config'].exist? # => true
66
- deploy_dir.dir('config').exist? # => true
67
- deploy_dir.file('config').exist? # => false
68
67
 
69
- deploy_dir['config'].dir? # => true
70
- deploy_dir['config'].file? # => false
68
+ # Checks
69
+ deploy_dir['config'].exist? # => true
70
+ deploy_dir.dir('config').exist? # => true
71
+ deploy_dir.file('config').exist? # => false
71
72
 
73
+ deploy_dir['config'].dir? # => true
74
+ deploy_dir['config'].file? # => false
72
75
 
73
- # Navigation
74
- config = deploy_dir['config']
75
- config.parent # => </apps/cool_app>
76
- config['../..'] # => </>
77
- config['../..'].dir? # => true
78
76
 
79
- deploy_dir.entries # => list of dirs and files, also support &block
80
- deploy_dir.files # => list of files, also support &block
81
- deploy_dir.dirs # => list of dirs, also support &block
77
+ # Navigation
78
+ config = deploy_dir['config']
79
+ config.parent # => </apps/cool_app>
80
+ config['../..'] # => </>
81
+ config['../..'].dir? # => true
82
82
 
83
+ deploy_dir.entries # => list of dirs and files, also support &block
84
+ deploy_dir.files # => list of files, also support &block
85
+ deploy_dir.dirs # => list of dirs, also support &block
86
+ ```
83
87
 
84
- # For more please go to specs (create/update/move/copy/destroy/...)
88
+ For more please go to specs (create/update/move/copy/destroy/...)
85
89
 
86
90
  ## Integration with [Vos][vos] (Virtual Operating System)
87
91
 
88
- server['apps/cool_app'].bash 'rails production'
92
+ ```ruby
93
+ server['apps/cool_app'].bash 'rails production'
94
+ ```
89
95
 
90
96
  For more details please go to [Vos][vos] project page.
91
97
  Or checkout configuration I use to control my production servers [My Cluster][my_cluster] in conjunction with small
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-02 00:00:00.000000000 +04:00
12
+ date: 2011-07-04 00:00:00.000000000 +04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
  description: