gistim 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03d622ef69c9d08fe19c0821b882f7fd7068e0c9185a2388b4fde375890f3ba4
4
- data.tar.gz: 16dfc4681a429cc0b9b076079c24fd807cc98fc5214ff6363cb0dfa810fc8c51
3
+ metadata.gz: 49d3454842b760ac8281097c64b55d2f4d919ee67d88ac148a7cab70c39e6eae
4
+ data.tar.gz: 5630ab2ad662f18edd4c49bebe72ca572684cb09346b60f8843bc5d65f0755e6
5
5
  SHA512:
6
- metadata.gz: 3f7b3089357162ccdb2892828f4328131d5d32bdb9e3d5cf498dbd0a25e5a51f6c8327e3efdfdc89abf36ba98ab2ce188c32fab41fb4c6914155b76ca0c7a968
7
- data.tar.gz: 18f689fb1200170b1f58f5c610253f467831179a710439af283c31b90d2d53e377c5ccd17b491b87f0e0bd4dbe893e8bb9b5fef0ab22568d21683432280739c9
6
+ metadata.gz: 930a9d53e6330574f0b8d4b9a3b28496eb7778087b78a885cb9cc781a489eafbf0066d6e6d12c13bf0d6973e8b14847cda506684dbc6be540445f984170c0b19
7
+ data.tar.gz: c441ec9667419f0e09b1f9131aa937aa696bbc506fb5eecacb1d880497d58963274735fd4aebe6d8e4b836fe400b1bcb0e49e14537093c04dc8c8bc502431c7e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gistim (0.2.2)
4
+ gistim (0.2.3)
5
5
  gist (~> 5)
6
6
 
7
7
  GEM
@@ -1,5 +1,6 @@
1
1
  #!/bin/bash -eu
2
2
 
3
+ readonly version=1.0.0
3
4
  readonly gistim_home=${GISTIM_HOME:-$HOME/gistim}
4
5
 
5
6
  mkdir -p "$gistim_home"
@@ -7,7 +8,7 @@ mkdir -p "$gistim_home"
7
8
  for arg in "$@"; do
8
9
  [ "$arg" = '--list' ] && find "$gistim_home" -type d -maxdepth 1 && exit
9
10
  [ "$arg" = '--path' ] && echo "$gistim_home" && exit
10
- [ "$arg" = '--version' ] && gistim --version && exit
11
+ [ "$arg" = '--version' ] && echo gistimnnow "$version" && exit
11
12
  done
12
13
 
13
14
  pushd "$gistim_home"
@@ -0,0 +1,39 @@
1
+ #!/bin/bash -eu
2
+
3
+ readonly command_name=gistimnow
4
+ readonly compress_file_name=install.tar.gz
5
+ readonly compress_file_url=https://raw.githubusercontent.com/YumaInaura/gistim/master/command/"$compress_file_name"
6
+ readonly command_home="$HOME"/"$command_name"
7
+ readonly download_tmp_dir="$HOME"/."$command_name"_install
8
+
9
+ function remove_tmp {
10
+ # !PREVENT WRONG REMOVING! Not use variable like `rm -rf "download_tmp_dir"`
11
+ rm -f "$HOME"/"$command_name"/"$compress_file_name"
12
+ rm -rf "$HOME"/."$command_name"_install
13
+ }
14
+ trap remove_tmp EXIT
15
+
16
+ readonly download_header=$(curl --head "$compress_file_url"?$(date +%s))
17
+ readonly download_ok=$(echo "$download_header" | grep 'OK')
18
+ [[ -z "$download_ok" ]] && echo "Download file not found" && echo "$compress_file_url" && echo "$download_header" && exit 1
19
+
20
+ # Create home dir
21
+ mkdir -p "$command_home"
22
+ mkdir -p "$download_tmp_dir"
23
+ curl -o "$download_tmp_dir"/"$compress_file_name" "$compress_file_url"?$(date +%s)
24
+
25
+ # Refresh libraries
26
+ cp "$download_tmp_dir"/"$compress_file_name" "$HOME"/"$command_name"/
27
+ pushd "$command_home"/
28
+ tar -xzf "$compress_file_name"
29
+ popd
30
+
31
+ # Link command to PATH
32
+ readonly command_path=/usr/local/bin/"$command_name"
33
+ rm -f "$command_path"
34
+ ln -s "$command_home"/command/"$command_name" "$command_path"
35
+
36
+ echo "installed"
37
+
38
+ eval "$command_name" --version
39
+
Binary file
@@ -13,9 +13,6 @@ module Gistim
13
13
  @url = create_empty
14
14
  clone
15
15
 
16
- File.write(url_file_path, url)
17
- File.write(hash_file_path, hash)
18
-
19
16
  File.delete(initialize_file_path)
20
17
 
21
18
  self
@@ -29,14 +26,6 @@ module Gistim
29
26
  @description ||= '# Hello Gist!'
30
27
  end
31
28
 
32
- def hash_file_path
33
- "#{directory}/.hash"
34
- end
35
-
36
- def url_file_path
37
- "#{directory}/.url"
38
- end
39
-
40
29
  def directory
41
30
  "#{Gistim::Command.home}/#{name}"
42
31
  end
@@ -1,3 +1,3 @@
1
1
  module Gistim
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gistim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yumainaura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-20 00:00:00.000000000 Z
11
+ date: 2018-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gist
@@ -88,7 +88,6 @@ executables:
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
- - "+x"
92
91
  - ".github.url"
93
92
  - ".gitignore"
94
93
  - ".rspec"
@@ -101,8 +100,10 @@ files:
101
100
  - README.md
102
101
  - Rakefile
103
102
  - bin/console
104
- - bin/gistimnow
105
103
  - bin/setup
104
+ - command/gistimnow
105
+ - command/install.sh
106
+ - command/install.tar.gz
106
107
  - exe/gistim
107
108
  - gistim.gemspec
108
109
  - lib/command/create.rb
data/+x DELETED
File without changes