tumblr-game 1.2 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/Main +2 -1
- data/lib/tumblr-game.rb +18 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5900c177c6240588cebbc1bb220d87dcf8f8b062
|
4
|
+
data.tar.gz: 9e0dc855bb9e3a0eb035453ff42c0c1f8d131535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd84dc14e57668cd86cc8558719b83c3fa8cc2a9549b2c0a219f665a94011615116597aab8b59f545d1425d1c9abc8b00455230685e127ab814c9c5873f2db99
|
7
|
+
data.tar.gz: 1097388d67f7b0bd6bdbb3563c0e59a3851dde33fcd379231b6ed95aef537364de6df63f922e8d3e759778f3282c060a84086080bb4fd5e845bb8fa52929c546
|
data/bin/Main
CHANGED
data/lib/tumblr-game.rb
CHANGED
@@ -3,11 +3,14 @@ require_relative 'tumblr-game/tumblr.rb'
|
|
3
3
|
|
4
4
|
class Game
|
5
5
|
|
6
|
+
## this function will accept the dimensions of the window to be created and initialize a Game object
|
6
7
|
def initialize(w, h) # dimensions of 1250 x 900 are appropriate
|
7
8
|
@width = w
|
8
9
|
@height = h
|
9
10
|
end
|
10
11
|
|
12
|
+
## this function will get the name of the blog from the user, and attempt to use the Tumblr API to query for pictures.
|
13
|
+
# if there is an error with the user input, say if it is empty or the blog is invalid, the game ends. the user must then re-execute the ruby file
|
11
14
|
def start
|
12
15
|
# ask for user input to get the blog name
|
13
16
|
puts "Enter the name of the blog: "
|
@@ -30,4 +33,19 @@ class Game
|
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|
36
|
+
|
37
|
+
## this function will delete the files that have been made over the course of the game. this must be called after Game.start in the main program file
|
38
|
+
def delete
|
39
|
+
File.delete( File.join(Dir.home, 'Desktop/image1.png'),
|
40
|
+
File.join(Dir.home, 'Desktop/image2.png'),
|
41
|
+
File.join(Dir.home, 'Desktop/image3.png'),
|
42
|
+
File.join(Dir.home, 'Desktop/image4.png'),
|
43
|
+
File.join(Dir.home, 'Desktop/image5.png'),
|
44
|
+
File.join(Dir.home, 'Desktop/image6.png'),
|
45
|
+
File.join(Dir.home, 'Desktop/image7.png'),
|
46
|
+
File.join(Dir.home, 'Desktop/image8.png'),
|
47
|
+
File.join(Dir.home, 'Desktop/image9.png'),
|
48
|
+
File.join(Dir.home, 'Desktop/image10.png')
|
49
|
+
)
|
50
|
+
end
|
33
51
|
end
|