study_line 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/study_line/version.rb +1 -1
- data/lib/study_line.rb +21 -10
- data/study_line-0.2.1.gem +0 -0
- data/study_line.gemspec +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65b3789eac88ddd9d55d3926be66ebf4ca3bd196ca0f808652fb6ca288ffa2d9
|
4
|
+
data.tar.gz: 430575c26dcba45eb59ecc2820328a3d4ebb1a31b0d5bbf3d3d02db3dbaeebb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 540dd1527c74a44029b2c072834daa1b90d7d7e0a0ed1bc8603ce87c29b0011d648557a34e0dd1857a14fa63c05c0737394dfa247d25e14fc47fbf102ba50791
|
7
|
+
data.tar.gz: 7ee67f154af89ccf6cb87d7a7d3c1d1c3d2c603ee5308cd2e8621dd510957837b220af69f4052a7078af1634035da5751cd374278497dfaae4ee246d70108886
|
data/lib/study_line/version.rb
CHANGED
data/lib/study_line.rb
CHANGED
@@ -2,23 +2,23 @@
|
|
2
2
|
|
3
3
|
require 'thor'
|
4
4
|
require 'httparty'
|
5
|
-
require '
|
6
|
-
|
5
|
+
require 'json'
|
6
|
+
|
7
|
+
CONFIG_FILE = File.join(Dir.home, '.stl_config')
|
7
8
|
|
8
9
|
module StudyLine
|
9
10
|
class CLI < Thor
|
10
11
|
desc "configure TOKEN", "トークンを設定します。"
|
11
12
|
def configure(token)
|
12
|
-
|
13
|
-
|
14
|
-
end
|
13
|
+
config = { 'CUSTOM_TOKEN' => token }
|
14
|
+
File.write(CONFIG_FILE, config.to_json)
|
15
15
|
puts "トークンが設定されました。"
|
16
16
|
end
|
17
17
|
|
18
18
|
class Sender
|
19
19
|
include HTTParty
|
20
|
-
|
21
|
-
BASE_URI = 'http://localhost:3000/api/study_sessions'
|
20
|
+
BASE_URI = 'https://studyline-cc21ae1829fc.herokuapp.com/api/study_sessions'
|
21
|
+
# BASE_URI = 'http://localhost:3000/api/study_sessions'
|
22
22
|
end
|
23
23
|
desc "start", "学習セッションの開始時間を記録します。"
|
24
24
|
method_option :tag, aliases: "-t", desc: "タグを作成オプション"
|
@@ -59,14 +59,25 @@ module StudyLine
|
|
59
59
|
|
60
60
|
desc "show_token", "保存されているトークンを表示します。"
|
61
61
|
def show
|
62
|
-
|
62
|
+
if File.exist?(CONFIG_FILE)
|
63
|
+
config = JSON.parse(File.read(CONFIG_FILE))
|
64
|
+
puts "現在のCUSTOM_TOKEN: #{config['CUSTOM_TOKEN'] || '未設定'}"
|
65
|
+
else
|
66
|
+
puts "トークンは未設定です。"
|
67
|
+
end
|
63
68
|
end
|
64
69
|
|
65
70
|
private
|
66
71
|
|
67
72
|
def user_token
|
68
|
-
|
69
|
-
|
73
|
+
if File.exist?(CONFIG_FILE)
|
74
|
+
config = JSON.parse(File.read(CONFIG_FILE))
|
75
|
+
config['CUSTOM_TOKEN'] || (raise "Error: Token not found.")
|
76
|
+
else
|
77
|
+
raise "Error: Token not found."
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
70
81
|
|
71
82
|
def headers
|
72
83
|
{
|
Binary file
|
data/study_line.gemspec
CHANGED
@@ -30,8 +30,8 @@ Gem::Specification.new do |spec|
|
|
30
30
|
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
|
31
31
|
end
|
32
32
|
end
|
33
|
-
spec.bindir = "
|
34
|
-
spec.executables = spec.files.grep(%r{\
|
33
|
+
spec.bindir = "bin"
|
34
|
+
spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
|
35
35
|
spec.require_paths = ["lib"]
|
36
36
|
|
37
37
|
# Uncomment to register a new dependency of your gem
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: study_line
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kentaro0215
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- lib/study_line.rb
|
55
55
|
- lib/study_line/version.rb
|
56
56
|
- sig/study_line.rbs
|
57
|
+
- study_line-0.2.1.gem
|
57
58
|
- study_line.gemspec
|
58
59
|
- vendor/bundle/ruby/3.2.0/bin/dotenv
|
59
60
|
- vendor/bundle/ruby/3.2.0/bin/htmldiff
|