hexapic 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8c9ad56c1964298f5438c95706490aac86ec9a5
4
- data.tar.gz: 788ab3ddb258ecec61d5b4c50afa9ff5f67bde34
3
+ metadata.gz: 48d064edd097a6afda83cc568cbc7c69ddf0a69d
4
+ data.tar.gz: 29458a8ea610e7947418e056e4400827f6f75b19
5
5
  SHA512:
6
- metadata.gz: 930acfb7a2ada5168f13bb92dadc64756bdda060f9278c2cdcfb6fbb51bc2e0f3c246a62286028d61fbfb07cb5a29521ca7c8d920595a68d8ae24048ec664c16
7
- data.tar.gz: 434a5f583f8c9b035f3a7bd44ba3b328d74cb01492a9d6a1121074081a61fb81182a4b334c62339b4b58d7140d7303a8a393a1c2db6464787eb1b09cfa324054
6
+ metadata.gz: 899df792cf0bea83c933cf7a0d6c1a2cd050da269c1a7d8ae435034cad58f98c71b413d068267de39ec940852050d64801fad1ff232abf920de5d317fb53a015
7
+ data.tar.gz: 8d1e18072868b42ccc9d0a29a811e91facddc923a01277369392b04be96aca5a304d429d6363ce1c0f5a9dd4f50b0174a7f5fd3370b1804b97c25a64495c9105
data/bin/hexapic CHANGED
@@ -10,10 +10,6 @@ end
10
10
  include Hexapic
11
11
  require 'choice'
12
12
 
13
- def help
14
- puts 'TODO: write help'
15
- end
16
-
17
13
  def set_wallpaper
18
14
  tags = Choice.choices[:tags] || ENV['WALLPAPER_TAGS'] || 'nature'
19
15
  repository = Choice.choices[:repository] || ENV['WALLPAPER_REPOSITPRY'] || :instagram
@@ -50,13 +46,13 @@ Choice.options do
50
46
  end
51
47
 
52
48
  if Choice.choices[:tags]
53
- #begin
49
+ begin
54
50
  set_wallpaper
55
- #rescue Exception => e
56
- # puts e.message
57
- #end
51
+ rescue Exception => e
52
+ puts e.message
53
+ end
58
54
  elsif Choice.choices[:version]
59
55
  print_version
60
56
  else
61
- help
57
+ Choice.help
62
58
  end
data/hexapic.gemspec CHANGED
@@ -11,6 +11,9 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Set desktop wallpaper from social networks'
12
12
  spec.description = "Pick a 6 latest pics from flickr, instagram or twitter, make collage of its and set it as Linux's background."
13
13
  spec.homepage = 'https://github.com/blan4/Hexapic'
14
+ spec.metadata = { 'issue_tracker' => 'https://github.com/blan4/Hexapic/issues' }
15
+ spec.post_install_message = 'Just call hexapic -t cat'
16
+ spec.required_ruby_version = '>= 1.9.3'
14
17
  spec.license = 'MIT'
15
18
 
16
19
  spec.files = `git ls-files -z`.split("\x0")
data/lib/hexapic/api.rb CHANGED
@@ -1,7 +1,3 @@
1
- require 'faraday'
2
- require 'json'
3
- require 'uri'
4
-
5
1
  module Hexapic
6
2
  module API
7
3
  class Instagram
@@ -1,5 +1,3 @@
1
- require 'mini_magick'
2
- require 'tempfile'
3
1
  module Hexapic
4
2
  class Collage
5
3
  attr_reader :height, :width
@@ -1,8 +1,12 @@
1
- require 'open3'
2
-
3
1
  module Hexapic
4
2
  class DesktopEnvironment
5
- DE = {'Metacity (Marco)'=> :mate, 'Xfwm4'=> :xfce4, 'Gnome3'=> :gnome3, 'Mutter (Muffin)'=> :cinnamon}
3
+ DE = {
4
+ 'Metacity (Marco)'=> :mate,
5
+ 'Xfwm4'=> :xfce4,
6
+ 'Gnome3'=> :gnome3,
7
+ 'Mutter (Muffin)'=> :cinnamon,
8
+ 'Gala' => :gala
9
+ }
6
10
 
7
11
  def self.which
8
12
  wm_name = nil
@@ -19,7 +23,7 @@ module Hexapic
19
23
  end
20
24
  end
21
25
 
22
- DE[wm_name]
26
+ DE[wm_name] || wm_name.to_sym
23
27
  end
24
28
  end
25
29
 
@@ -1,5 +1,3 @@
1
- require 'fileutils'
2
-
3
1
  module Hexapic
4
2
  class Downloader
5
3
  def self.get(picture)
@@ -1,4 +1,3 @@
1
- require 'flickr'
2
1
  module Hexapic
3
2
  module Repository
4
3
  COUNT = 6
@@ -1,3 +1,3 @@
1
1
  module Hexapic
2
- VERSION = "0.1.2"
2
+ VERSION = '0.1.3'
3
3
  end
@@ -1,4 +1,3 @@
1
- require_relative "desktop_environment"
2
1
  module Hexapic
3
2
  module WallpaperSetter
4
3
  class XFCE4
@@ -31,11 +30,22 @@ module Hexapic
31
30
  end
32
31
  end
33
32
 
34
- DE = {mate: Mate, gnome3: Gnome3, xfce4: XFCE4, kde4: KDE4}
33
+ SETTER = {
34
+ mate: Mate,
35
+ gnome3: Gnome3,
36
+ xfce4: XFCE4,
37
+ kde4: KDE4,
38
+ gala: Gnome3
39
+ }
35
40
 
36
41
  def self.build
37
- klass = DE[DesktopEnvironment.which]
38
- klass.new unless klass.nil?
42
+ de = DesktopEnvironment.which
43
+ klass = SETTER[de]
44
+ if klass.nil?
45
+ raise "Unsupported DE #{de}. Please ask maitainer about it."
46
+ else
47
+ klass.new
48
+ end
39
49
  end
40
50
  end
41
51
  end
data/lib/hexapic.rb CHANGED
@@ -1,6 +1,16 @@
1
1
  $LOAD_PATH.unshift File.expand_path('.')
2
2
 
3
+ require 'faraday'
4
+ require 'json'
5
+ require 'uri'
6
+ require 'open3'
7
+ require 'mini_magick'
8
+ require 'tempfile'
9
+ require 'fileutils'
10
+ require 'flickr'
11
+
3
12
  require 'hexapic/version'
13
+ require 'hexapic/desktop_environment.rb'
4
14
  require 'hexapic/wallpaper_setter'
5
15
  require 'hexapic/api'
6
16
  require 'hexapic/repository'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hexapic
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
  - Ilya Siganov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-15 00:00:00.000000000 Z
11
+ date: 2014-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -139,8 +139,9 @@ files:
139
139
  homepage: https://github.com/blan4/Hexapic
140
140
  licenses:
141
141
  - MIT
142
- metadata: {}
143
- post_install_message:
142
+ metadata:
143
+ issue_tracker: https://github.com/blan4/Hexapic/issues
144
+ post_install_message: Just call hexapic -t cat
144
145
  rdoc_options: []
145
146
  require_paths:
146
147
  - lib
@@ -148,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
149
  requirements:
149
150
  - - ">="
150
151
  - !ruby/object:Gem::Version
151
- version: '0'
152
+ version: 1.9.3
152
153
  required_rubygems_version: !ruby/object:Gem::Requirement
153
154
  requirements:
154
155
  - - ">="