Class: Bundix::ShellNixContext

Inherits:
Struct
  • Object
show all
Defined in:
lib/bundix/shell_nix_context.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#gemfileObject

Returns the value of attribute gemfile

Returns:

  • (Object)

    the current value of gemfile



2
3
4
# File 'lib/bundix/shell_nix_context.rb', line 2

def gemfile
  @gemfile
end

#gemsetObject

Returns the value of attribute gemset

Returns:

  • (Object)

    the current value of gemset



2
3
4
# File 'lib/bundix/shell_nix_context.rb', line 2

def gemset
  @gemset
end

#lockfileObject

Returns the value of attribute lockfile

Returns:

  • (Object)

    the current value of lockfile



2
3
4
# File 'lib/bundix/shell_nix_context.rb', line 2

def lockfile
  @lockfile
end

#projectObject

Returns the value of attribute project

Returns:

  • (Object)

    the current value of project



2
3
4
# File 'lib/bundix/shell_nix_context.rb', line 2

def project
  @project
end

#rubyObject

Returns the value of attribute ruby

Returns:

  • (Object)

    the current value of ruby



2
3
4
# File 'lib/bundix/shell_nix_context.rb', line 2

def ruby
  @ruby
end

Class Method Details

.from_hash(hash) ⇒ Object



3
4
5
# File 'lib/bundix/shell_nix_context.rb', line 3

def self.from_hash(hash)
  new(*hash.values_at(*members))
end

Instance Method Details

#bindObject



7
8
9
# File 'lib/bundix/shell_nix_context.rb', line 7

def bind
  binding
end

#gemfile_pathObject



15
16
17
# File 'lib/bundix/shell_nix_context.rb', line 15

def gemfile_path
  path_for(gemfile)
end

#gemset_pathObject



23
24
25
# File 'lib/bundix/shell_nix_context.rb', line 23

def gemset_path
  path_for(gemset)
end

#lockfile_pathObject



19
20
21
# File 'lib/bundix/shell_nix_context.rb', line 19

def lockfile_path
  path_for(lockfile)
end

#path_for(file) ⇒ Object



11
12
13
# File 'lib/bundix/shell_nix_context.rb', line 11

def path_for(file)
  Nixer.serialize(Pathname(file).relative_path_from(Pathname('./')))
end