Class: SvnTransform::Dir
- Inherits:
-
Object
- Object
- SvnTransform::Dir
- Defined in:
- lib/svn-transform/dir.rb
Overview
A directory in original Subversion Repository, at a given changeset. Instances are initialized by SvnTransform#changesets.
An instance for each file in the original repo at each revision will be passed to any directory transform blocks (TODO more info)
Although more could theoretically be done (see #initialize fixture_dir param), the main thing intended to be alterable are the properties.
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#fixture_dir ⇒ Object
readonly
Returns the value of attribute fixture_dir.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#repos ⇒ Object
readonly
Returns the value of attribute repos.
-
#rev_num ⇒ Object
readonly
Returns the value of attribute rev_num.
-
#rev_props ⇒ Object
readonly
Returns the value of attribute rev_props.
Instance Method Summary collapse
-
#basename ⇒ Object
Get the base of the File.
-
#initialize(path, node_data, rev_num, rev_props, repos, fixture_dir) ⇒ Dir
constructor
Initialize Dir instance using data passed by SvnTransform#changesets.
Constructor Details
#initialize(path, node_data, rev_num, rev_props, repos, fixture_dir) ⇒ Dir
Initialize Dir instance using data passed by SvnTransform#changesets. This is data that will be available to Transformation blocks. It’s relevant to remember that all this happens within a block given to an SvnFixture::Revision.
Parameters
- path<Pathname>
-
Full path within original Repository
- node_data<Array[String, Hash]>
-
Array returned by SWIG::TYPE_p_svn_ra_session_t#dir. First element is a Hash of directory entries, second is Hash of properties.
- rev_num<Integer>
-
Number of current revision
- rev_props<Hash>
-
Properties for current revision
- repos<Svn::Ra::Session>
-
Repo session (made available for PropsToYaml)
- fixture_dir<SvnFixture::Directory>
-
The SvnFixture::Directory representing this directory. This could be used to add, delete files, subdirs, etc, but doing much of that is likely to lead to weird results. I certainly don’t intend to test this outside of one use case (PropsToYaml)
33 34 35 36 37 38 39 40 41 |
# File 'lib/svn-transform/dir.rb', line 33 def initialize(path, node_data, rev_num, rev_props, repos, fixture_dir) @path = path.kind_of?(Pathname) ? path : Pathname.new(path) @entries = node_data[0] @properties = node_data[1] @rev_num = rev_num @rev_props = rev_props @repos = repos @fixture_dir = fixture_dir end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
43 44 45 |
# File 'lib/svn-transform/dir.rb', line 43 def entries @entries end |
#fixture_dir ⇒ Object (readonly)
Returns the value of attribute fixture_dir.
43 44 45 |
# File 'lib/svn-transform/dir.rb', line 43 def fixture_dir @fixture_dir end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
43 44 45 |
# File 'lib/svn-transform/dir.rb', line 43 def path @path end |
#properties ⇒ Object
Returns the value of attribute properties.
43 44 45 |
# File 'lib/svn-transform/dir.rb', line 43 def properties @properties end |
#repos ⇒ Object (readonly)
Returns the value of attribute repos.
43 44 45 |
# File 'lib/svn-transform/dir.rb', line 43 def repos @repos end |
#rev_num ⇒ Object (readonly)
Returns the value of attribute rev_num.
43 44 45 |
# File 'lib/svn-transform/dir.rb', line 43 def rev_num @rev_num end |
#rev_props ⇒ Object (readonly)
Returns the value of attribute rev_props.
43 44 45 |
# File 'lib/svn-transform/dir.rb', line 43 def rev_props @rev_props end |
Instance Method Details
#basename ⇒ Object
Get the base of the File
61 62 63 |
# File 'lib/svn-transform/dir.rb', line 61 def basename @path.basename.to_s end |