sipo_mailer 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 35eb2910aa10ad4d9aa5828307ccdd78f2a12c4e
4
- data.tar.gz: d411582229cbb92b754b7d75b435a1132b1ce66c
3
+ metadata.gz: bfb8d067f081a1b7165a024e92ce6d24abcefc4f
4
+ data.tar.gz: '090fb0f9d81912c3f89f95f03b6569118d0ea0d3'
5
5
  SHA512:
6
- metadata.gz: 2afa7e759d778b70e88cb9e25307afe648bc858e8de2ef07fc6536694b6560145e9cde8b76440cb28cc619299867bf6fd92401c5d3c632974fda99cf080cc91a
7
- data.tar.gz: 0dd2339f220f4baadf8cd3a77220b54ab63c21b59447e98f0375abf059c944bd2b9da9a00a6e671beb8be6bd6f0520e71822dc34441d41394a525cb6622001b7
6
+ metadata.gz: 48f23393984863d33b0a00c3ebc87ab60911fde1b148943c32db9da6a52841aba45221c4acc9501c7b45dc114039d78848bc3730f4817d30c2f3f43e32d6d8c0
7
+ data.tar.gz: 4bb01be08990d2005806aac04f737e7c8b682b8e73428a7964b905fb0cd06f272d2eac95131cd83c9bf228ee90a0d0ad3744bc18e3b7d9a50b7bd7ff2cd97a78
@@ -0,0 +1,2 @@
1
+ cislo;email
2
+ 1;landovsky@gmail.com
@@ -1,4 +1,4 @@
1
1
  address_book: /sipo/spec/fixtures/adresar.csv
2
2
  email:
3
- address: @gmail.com
3
+ address: neco@gmail.com
4
4
  password:
@@ -10,7 +10,6 @@ services:
10
10
  build:
11
11
  context: .
12
12
  command: bash
13
- env_file: .env
14
13
  tty: true
15
14
  stdin_open: true
16
15
  volumes:
@@ -5,7 +5,8 @@ module SipoMailer
5
5
 
6
6
  class << self
7
7
  def install
8
- create_dir ? copy_config : nil
8
+ create_dir
9
+ copy_files
9
10
  end
10
11
 
11
12
  def create_dir
@@ -13,16 +14,31 @@ module SipoMailer
13
14
  result == 0
14
15
  end
15
16
 
16
- def copy_config
17
- return false if File.exist? config
18
- File.open("#{config_dir}/#{CONFIG_FILE}", 'w') do |file|
19
- example = File.open("config/#{CONFIG_FILE}.example")
20
- file.write(example.readlines.join(''))
21
- example.close
17
+ def copy_files
18
+ copy_file(config_example, CONFIG_FILE)
19
+ copy_file(book_example, 'adresar.csv')
20
+ end
21
+
22
+ def copy_file(src, dest)
23
+ return false if File.exist? dest
24
+ File.open("#{config_dir}/#{dest}", 'w') do |file|
25
+ source = File.open(src)
26
+ file.write(source.readlines.join(''))
27
+ source.close
22
28
  end
23
29
  true
24
30
  end
25
31
 
32
+ def config_example
33
+ example_path = Gem.bin_path('sipo_mailer', 'mailer').split('/')[0..-3]
34
+ [example_path, 'config', "#{CONFIG_FILE}.example"].join('/')
35
+ end
36
+
37
+ def book_example
38
+ example_path = Gem.bin_path('sipo_mailer', 'mailer').split('/')[0..-3]
39
+ [example_path, 'config', 'adresar.csv.example'].join('/')
40
+ end
41
+
26
42
  def config
27
43
  [config_dir, CONFIG_FILE].join('/')
28
44
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
- s.name = 'sipo_mailer'
3
- s.version = '0.0.1'
2
+ s.name = 'sipo_mailer' # remember to change /Users/landovsky/git/sipo/lib/sipo_mailer/utils/installer.rb:27
3
+ s.version = '0.0.2'
4
4
  s.summary = 'Command-line aplikace na odesílání souborů jako příloh na email dle CSV adresáře.'
5
5
  s.author = 'Tomáš Landovský'
6
6
  s.email = 'landovsky@gmail.com'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sipo_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomáš Landovský
@@ -123,6 +123,7 @@ files:
123
123
  - Gemfile.lock
124
124
  - bin/console
125
125
  - bin/mailer
126
+ - config/adresar.csv.example
126
127
  - config/config.yml.example
127
128
  - docker-compose.yml
128
129
  - lib/sipo_mailer.rb