hungrynoodle 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/hungrynoodle.rb +11 -1
  2. metadata +3 -3
@@ -76,7 +76,17 @@ class HungryNoodle
76
76
  # Provides a simple pass-thru mechansim for SQL to the underlying db
77
77
  def execute(sql)
78
78
  @db.execute(sql)
79
- end
79
+ end
80
+
81
+ # Return a flattened list of basenames
82
+ def basenames
83
+ @db.execute("select basename from files").flatten!
84
+ end
85
+
86
+ # Return file details for a given basename
87
+ def file(basename)
88
+ @db.execute("select * from files where basename = '#{basename}'")
89
+ end
80
90
 
81
91
  # Does this file exists in the cache ? This method performs a lookup
82
92
  # based on filename and size. If a matching file is found, the contents
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hungrynoodle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Philip Mcmahon