Commits

Anonymous committed 1e8c901

Converted all scripts to YAML::XS.

Comments (0)

Files changed (3)

1st-version-as-scripts/prepare-yaml.pl

 use warnings;
 
 use File::Spec;
-use YAML;
+use YAML::XS;
 
 opendir my $cwd, ".";
 my @paths = sort { $a cmp $b } grep { /\.(jpg|png)$/ } (File::Spec->no_upwards(readdir($cwd)));
 {
     die "YAML File already exists!";
 }
-open my $yaml, ">", $yaml_fn;
-print {$yaml} Dump(
+YAML::XS::DumpFile(
+    $yaml_fn,
     {
         common_tags => [],
         files =>
             }
             @paths),
         ],
-    }
+    },
 );
-close($yaml);
 

1st-version-as-scripts/upload-spec.yml

 ---
 common_tags: []
 files:
-  - description_parts:
-      - ''
-      - ''
-      - ''
-      - ''
-      - ''
-    filename: img_7953.jpg
-    tags: []
-    title: ''
-  - description_parts:
-      - ''
-      - ''
-      - ''
-      - ''
-      - ''
-    filename: img_7954.jpg
-    tags: []
-    title: ''
-  - description_parts:
-      - ''
-      - ''
-      - ''
-      - ''
-      - ''
-    filename: img_7957.jpg
-    tags: []
-    title: ''
-  - description_parts:
-      - ''
-      - ''
-      - ''
-      - ''
-      - ''
-    filename: img_7958.jpg
-    tags: []
-    title: ''
+- description_parts:
+  - ''
+  - ''
+  - ''
+  - ''
+  - ''
+  filename: img_7953.jpg
+  tags: []
+  title: ''
+- description_parts:
+  - ''
+  - ''
+  - ''
+  - ''
+  - ''
+  filename: img_7954.jpg
+  tags: []
+  title: ''
+- description_parts:
+  - ''
+  - ''
+  - ''
+  - ''
+  - ''
+  filename: img_7957.jpg
+  tags: []
+  title: ''
+- description_parts:
+  - ''
+  - ''
+  - ''
+  - ''
+  - ''
+  filename: img_7958.jpg
+  tags: []
+  title: ''

1st-version-as-scripts/upload.pl

 use strict;
 use warnings;
 
-use YAML;
+use YAML::XS;
 use Carp;
 
 use Flickr::Upload;
 
-my $data = YAML::LoadFile("upload-spec.yml");
+my $data = YAML::XS::LoadFile("upload-spec.yml");
 
 my $common_tags = $data->{common_tags};
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.