middle_drive 0.0.1 → 0.0.2

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: ba7b7747573e5f6690179713223393910fa2664b
4
- data.tar.gz: acb0ca669048f636ac2c773438ac1a5f9b75ce7d
3
+ metadata.gz: ae7dbdefe594f689969acb1a2b40ad63e6e0d950
4
+ data.tar.gz: e98c9f4473c43bfff27a9e5767b1255048eac2b9
5
5
  SHA512:
6
- metadata.gz: 4006127ef94388103cd1c0b8bf756a4d7f8e6fcb90a1c390753e527f8eb70dd8bea5868d69349d237c46a534981a160c8fb3d514d7ca0cf787a50935c9945f72
7
- data.tar.gz: 67739a85be32aa0a59724aee84592316c4f5445c266d66c602a9f6f2f8e18ca3cd665cbce2029e643817ab5c48f3d483dd12154a5aa5e309a1c0c6f1a38317a5
6
+ metadata.gz: 7c90da3f1721d1e4dd50fe805c02bccd5698e7ba39fec2b15c6953e4560201ad4be3c47a0a10c08857d06522073bf5cbfdb75daa165e5f8f8e7e776140f245d3
7
+ data.tar.gz: bd5362f1dfc25035650dfcc10b7a7ac86ec7d79c3646e8dec574d12c24bb7414c4d08966e5557ecc983c4d5c026adb178b6f9a3634e9d96d7f3c6bc2a689a158
data/README.md CHANGED
@@ -21,19 +21,24 @@ Then run
21
21
 
22
22
  ## Setup
23
23
 
24
- middle_drive init
24
+ ### Middleman setup
25
25
 
26
- ## Usage
26
+ middle_drive init
27
27
 
28
- middle_drive
28
+ ### Google drive setup conventions
29
29
 
30
- ## Conventions
30
+ - create a new collection in your google drive. Name it the same like in `middle_drive.yml`'s `site.collection` value.
31
+ - create google spreadsheet named `pages` inside this collection. You can name it differently if you specify it for `site.pages`
32
+ - each tab in this spreadsheet represents a page
33
+ - value in first row and first column represents a template which will be used by middleman
34
+ ![Example](/img/spreadsheet.png)
31
35
 
32
- `pages` must be a spreadsheet which contains pages, separated into worksheets (tabs).
36
+ ## Usage
33
37
 
34
- ### Middleman config for dynamic pages
38
+ middle_drive
35
39
 
36
- Copy `config.MIDDLEMAN.rb` to `config.rb` to your Middleman app.
40
+ This command will sync images and page information from your Google Drive collection which was set in
41
+ `middle_drive.yml` file.
37
42
 
38
43
  ## TODO
39
44
  - http://middlemanapp.com/advanced/local-data/
data/bin/middle_drive CHANGED
@@ -7,12 +7,27 @@ elsif ARGV[0] == 'init'
7
7
  current_user_dir = Dir.pwd
8
8
  gem_dir = "#{File.dirname(__FILE__)}/.."
9
9
 
10
- cmd_middle_drive_settings = "cp #{gem_dir}/middle_drive.SAMPLE.yml #{current_user_dir}/middle_drive.yml"
11
- cmd_middleman_config = "cp #{gem_dir}/config.MIDDLEMAN.rb #{current_user_dir}/config.rb"
10
+ middle_drive_yml = "#{current_user_dir}/middle_drive.yml"
11
+ middleman_config = "#{current_user_dir}/config.rb"
12
12
 
13
- p 'Writing middle_drive.yml'
14
- system(cmd_middle_drive_settings)
13
+ cmd_middle_drive_settings = "cp #{gem_dir}/middle_drive.SAMPLE.yml #{middle_drive_yml}"
14
+ cmd_middleman_config = "cp #{gem_dir}/config.MIDDLEMAN.rb #{middleman_config}"
15
15
 
16
- p 'Writing config.rb for'
17
- system(cmd_middleman_config)
16
+ unless File.exist?(middle_drive_yml)
17
+ p 'Writing middle_drive.yml'
18
+ system(cmd_middle_drive_settings)
19
+ end
20
+
21
+ unless File.exist?(middle_drive_yml)
22
+ p 'Writing config.rb for'
23
+ system(cmd_middleman_config)
24
+ end
25
+
26
+ gitignore = "#{current_user_dir}/.gitignore"
27
+ already_ignored = File.open(gitignore).each_line.any? { |line| line.chomp == 'middle_drive.yml'}
28
+
29
+ unless already_ignored
30
+ p 'Putting middle_drive.yml to your .gitignore'
31
+ system("echo middle_drive.yml >> #{current_user_dir}/.gitignore")
32
+ end
18
33
  end
Binary file
@@ -1,3 +1,3 @@
1
1
  module MiddleDrive
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middle_drive
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
  - Ziga Vidic
@@ -70,6 +70,7 @@ files:
70
70
  - build/locales/.gitkeep
71
71
  - build/source/images/.gitkeep
72
72
  - config.MIDDLEMAN.rb
73
+ - img/spreadsheet.png
73
74
  - lib/middle_drive.rb
74
75
  - lib/middle_drive/config.rb
75
76
  - lib/middle_drive/image.rb