miga-base 0.7.12.1 → 0.7.12.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 881c30021a8c7e8219dd2fad710bc3049eb56ce1307c0507607b3dd2c83ab296
4
- data.tar.gz: 34b47f66564a02413b79e12fa19cf181c639c50ae28030cef624634485c8af9b
3
+ metadata.gz: c57b841cc84841ebfd868af862204179e443d37eb4ec5550ea9ef7df63b9d933
4
+ data.tar.gz: 5512fe8305c2b6193f5d1a5c99e663ef480be32db2e8bdc7087826bdeeae5b35
5
5
  SHA512:
6
- metadata.gz: fb36047b431765f2227e991d7adb5a2899801018a067227e581d8e0b63999082099c8f41138395ce83c86e7664284a9cb9267c280138d62656a8b671ffda2bee
7
- data.tar.gz: ec59a539424db91f6744799ea022c1aa56c39123b4c43e19f1ce20b01954c16c90e481a4e062d3ed01d912f57eda4c29123047399041889ba1997a4eb839f94d
6
+ metadata.gz: 63e095dded680c2a6d1519d8fc8788d4d44cf523fc84b9e67ee453dffb9f05c75e2acafc283b511f6b27638e678d53f7362b056f35d18d5b08893419c7d24302
7
+ data.tar.gz: efac7f7c3d65640b64dc6d9b32e3bd520faebda05a72f1b88a2ee4c11546b5366db1ac42ea296ba73fe1f7873244a9f64791a180c9094a374a7ebbf1c589d491
@@ -46,7 +46,8 @@ class MiGA::Cli::Action::Browse < MiGA::Cli::Action
46
46
 
47
47
  # Summaries
48
48
  summaries = Dir["#{p.path}/*.tsv"].map do |i|
49
- "<li><a href='file://#{i}'>#{File.basename(i)}</a></li>"
49
+ b = File.basename(i)
50
+ "<li><a href='../#{b}'>#{b}</a></li>"
50
51
  end.join('')
51
52
 
52
53
  # Project index page
@@ -162,7 +163,7 @@ class MiGA::Cli::Action::Browse < MiGA::Cli::Action
162
163
  links = []
163
164
  res.each_file do |key, _|
164
165
  name = format_name(key)
165
- links << "<a href='file://#{res.file_path(key)}'>#{name}</a><br/>"
166
+ links << "<a href='../#{res.file_path(key, true)}'>#{name}</a><br/>"
166
167
  end
167
168
  links.empty? ? nil : links.join('')
168
169
  end
@@ -81,20 +81,22 @@ class MiGA::Result < MiGA::MiGA
81
81
  end
82
82
 
83
83
  ##
84
- # Directory containing the result
85
- def dir
86
- File.dirname(path)
84
+ # Directory containing the result; by default an absolute path, if
85
+ # +relative+ is true returns the path relative to the parent project
86
+ def dir(relative = false)
87
+ relative ? relative_dir : File.dirname(path)
87
88
  end
88
89
 
89
90
  ##
90
- # Absolute path to the file(s) defined by symbol +k+
91
- def file_path(k)
91
+ # Absolute path to the file(s) defined by symbol +k+, or relative
92
+ # path if +relative+ is true
93
+ def file_path(k, relative = false)
92
94
  k = k.to_sym
93
95
  f = self[:files].nil? ? nil : self[:files][k]
94
96
  return nil if f.nil?
95
- return File.expand_path(f, dir) unless f.is_a? Array
97
+ return File.join(dir(relative), f) unless f.is_a? Array
96
98
 
97
- f.map { |fi| File.expand_path(fi, dir) }
99
+ f.map { |fi| File.join(dir(relative), fi) }
98
100
  end
99
101
 
100
102
  ##
@@ -8,7 +8,7 @@ module MiGA
8
8
  # - Float representing the major.minor version.
9
9
  # - Integer representing gem releases of the current version.
10
10
  # - Integer representing minor changes that require new version number.
11
- VERSION = [0.7, 12, 1]
11
+ VERSION = [0.7, 12, 2]
12
12
 
13
13
  ##
14
14
  # Nickname for the current major.minor version.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miga-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.12.1
4
+ version: 0.7.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R