stashify 1.0.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/stashify/directory/local.rb +1 -1
- data/lib/stashify/directory.rb +2 -2
- data/lib/stashify/file/local.rb +1 -6
- data/lib/stashify/file.rb +6 -4
- data/lib/stashify/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 697f326f121f3cc9dbf626549584f903654c5d74961715b48514d42654ce0fe1
|
4
|
+
data.tar.gz: f635334a6ab5e9238e198e8f6f02694f18e51dcf6d2d294b80d3e3dc2012b144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39bc5150f32fd837778a14812309ceb9c383c9ddd5391a6aeaa95e32f8a077ab227343024e17d0070941e16ef6ca86fbf8c2118a9b1d15591830dbee0607c0a8
|
7
|
+
data.tar.gz: 0ef5f2314cec0a340c6e9913549367ece3109706967e7bd9f13751eaf2e6532f11e2f68288a825166c49db0d0ac0c2049d11f64672f2cb76c88ff0c16a66c7c0
|
data/Gemfile.lock
CHANGED
data/lib/stashify/directory.rb
CHANGED
data/lib/stashify/file/local.rb
CHANGED
@@ -5,13 +5,8 @@ require "stashify/file"
|
|
5
5
|
module Stashify
|
6
6
|
class File
|
7
7
|
class Local < Stashify::File
|
8
|
-
def initialize(path)
|
9
|
-
@path = path
|
10
|
-
super(name: ::File.basename(path), contents: nil)
|
11
|
-
end
|
12
|
-
|
13
8
|
def contents
|
14
|
-
::File.read(
|
9
|
+
::File.read(path)
|
15
10
|
end
|
16
11
|
end
|
17
12
|
end
|
data/lib/stashify/file.rb
CHANGED
@@ -4,12 +4,14 @@ require "stashify"
|
|
4
4
|
|
5
5
|
module Stashify
|
6
6
|
class File
|
7
|
-
attr_reader :name, :contents
|
7
|
+
attr_reader :name, :path, :contents
|
8
8
|
|
9
|
-
def initialize(name
|
10
|
-
raise
|
9
|
+
def initialize(name: nil, path: nil, contents: "")
|
10
|
+
raise StandardError, "name or path must be defined" unless name || path
|
11
|
+
raise Stashify::InvalidFile, "Name '#{name}' contains a /" if name && name =~ %r{/}
|
11
12
|
|
12
|
-
@
|
13
|
+
@path = path
|
14
|
+
@name = name || ::File.basename(path)
|
13
15
|
@contents = contents
|
14
16
|
end
|
15
17
|
|
data/lib/stashify/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stashify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lambda Null
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Provides an abstraction to various services (local filesystem, S3, etc)
|
14
14
|
email:
|