study_line 0.2.1 → 0.2.3

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: 2ec10d6c6bf78014d7c19a20ec4806ca0630d521c2f021224b05fd34604f6d95
4
- data.tar.gz: c94387fe464cd74b1daf3b63c3a8cabd8590e9e5d957bbace0b026fd807397ba
3
+ metadata.gz: 3474d35e01fe32641c8d9569c4ba87fea1aa818006574d7985b60a3204ad833a
4
+ data.tar.gz: 727bce089e88979e2acbbb2f7ae722128eff54380a8f8d4aca83722e68e8f740
5
5
  SHA512:
6
- metadata.gz: 44274813dd9a653f1d3062878953da73fa80b03d6ddcb074535a9338e653ed805e67ba5a96b085c76673f74132907b803bc2b56d72f5cd31ee2c1f96086112db
7
- data.tar.gz: e815a2ec9e6500cdc5dc0c84d15bf95ba76e75d54fddd6f6c90f61b6b60f4989689296c493fccd5a6097111c69f9fcd7d24f6403af8ee90d8962cc16e2a6028b
6
+ metadata.gz: 5752fe9f7b2ef2438f49ace1ed6d8ffb31391471229316689d8103d293075322e730926e1c1bc5f51366611c30b846f295a01459137296c1a4e17f8c66272645
7
+ data.tar.gz: 7b5af17f8093b0cefe179b072742b1a138763d6b436ad76aa70b3bcb3969da569a5aef0c40bf8d329a61954da78fcba0b37dfec99268f9e79cdae17b84732228
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StudyLine
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.3"
5
5
  end
data/lib/study_line.rb CHANGED
@@ -2,16 +2,16 @@
2
2
 
3
3
  require 'thor'
4
4
  require 'httparty'
5
- require 'dotenv'
6
- Dotenv.load
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
- File.open('.env', 'w') do |file|
13
- file.puts "CUSTOM_TOKEN=#{token}"
14
- end
13
+ config = { 'CUSTOM_TOKEN' => token }
14
+ File.write(CONFIG_FILE, config.to_json)
15
15
  puts "トークンが設定されました。"
16
16
  end
17
17
 
@@ -59,14 +59,25 @@ module StudyLine
59
59
 
60
60
  desc "show_token", "保存されているトークンを表示します。"
61
61
  def show
62
- puts "現在のCUSTOM_TOKEN: #{ENV['CUSTOM_TOKEN'] || '未設定'}"
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
- ENV['CUSTOM_TOKEN'] || (raise "Error: Token not found.")
69
- end
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
Binary file
data/study_line.gemspec CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
22
22
  # Specify which files should be added to the gem when it is released.
23
23
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
24
  spec.add_dependency "httparty", "~> 0.18"
25
- spec.add_dependency "dotenv", "~> 2.7"
26
25
 
27
26
  spec.files = Dir.chdir(__dir__) do
28
27
  `git ls-files -z`.split("\x0").reject do |f|
@@ -30,8 +29,8 @@ Gem::Specification.new do |spec|
30
29
  f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
31
30
  end
32
31
  end
33
- spec.bindir = "bin"
34
- spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
32
+ spec.bindir = "exe"
33
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
35
34
  spec.require_paths = ["lib"]
36
35
 
37
36
  # Uncomment to register a new dependency of your gem
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: study_line
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kentaro0215
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2024-01-17 00:00:00.000000000 Z
12
12
  dependencies:
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.18'
27
- - !ruby/object:Gem::Dependency
28
- name: dotenv
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '2.7'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.7'
41
27
  description:
42
28
  email:
43
29
  - ken.runteq0215@gmail.com
@@ -54,7 +40,8 @@ files:
54
40
  - lib/study_line.rb
55
41
  - lib/study_line/version.rb
56
42
  - sig/study_line.rbs
57
- - study_line-0.2.0.gem
43
+ - study_line-0.2.1.gem
44
+ - study_line-0.2.2.gem
58
45
  - study_line.gemspec
59
46
  - vendor/bundle/ruby/3.2.0/bin/dotenv
60
47
  - vendor/bundle/ruby/3.2.0/bin/htmldiff
data/study_line-0.2.0.gem DELETED
Binary file