hotspot-login 0.1.2 → 0.1.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/hl.rb +11 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06e51e32b4c2fdf94fd714d41a182a5cd4cd6dbf
4
- data.tar.gz: 80aad1033c0c7c7a99ef09c3d431b4e94dba1a83
3
+ metadata.gz: a70630d93f452c7cbbff39a618dfa3348b45bad0
4
+ data.tar.gz: 4b90b2f9aa69adf1bd24bc42b67b542698164f23
5
5
  SHA512:
6
- metadata.gz: 72e5111b8d1b7729acd2bde0a463dbe7b0346ec45db8807c352c1900961a0b971111e1295b5a188de494ac916692e787efeaf2bed255679b92c07a856458d449
7
- data.tar.gz: d56ac9a6f2d35354975ee9a734106c104b7fee1581d6092efe0e666d1b713aaf024a136877d933a6f595ba9d2be1e82d6db844d2d6ffd5f2f6af2963a11068c3
6
+ metadata.gz: 716a1e19f5606cac7e07841890b94d7a02b789e3eec382ed9900defb1260c474ffc36c6e23946a5ca55d4e62562332f778f2ac5417cc5a9d1eefb7e40af37464
7
+ data.tar.gz: c8902b94884b90787fd759daa0d02308653d4ad08df5c08ad8e0a243c5f52d69a2cbab769cd604b89e94a28929ba6657db8095de436981f854a332a64bbf2143
data/bin/hl.rb CHANGED
@@ -55,17 +55,20 @@ class Hotspot_Login
55
55
  path = Dir.home + "/.config/hl.yml"
56
56
 
57
57
  if not File.exists? path
58
- open(path, 'w') do |f|
59
- f.puts "# profile:\n"
60
- f.puts "# :hotspot: sfr or free or uppa\n"
61
- f.puts "# :user:\n"
62
- f.puts "# :password:\n"
63
- f.puts "profile: null:\n"
58
+ if File.exists? "/etc/hl.yml"
59
+ path = "/etc/hl.yml"
60
+ else
61
+ open(path, 'w') do |f|
62
+ f.puts "# profile:\n"
63
+ f.puts "# :hotspot: sfr or free or uppa\n"
64
+ f.puts "# :user:\n"
65
+ f.puts "# :password:\n"
66
+ f.puts "profile: null:\n"
67
+ end
64
68
  end
65
69
  end
66
70
 
67
-
68
- file = File.open(Dir.home + "/.config/hl.yml")
71
+ file = File.open(path)
69
72
  config.merge! YAML.load(file)
70
73
  end
71
74
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotspot-login
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Jeser